コンテンツにスキップ
PHP Ecosystem
Explore

Testing

このコンテンツはまだ日本語訳がありません。

This package provides a consistent set of Composer scripts for local validation.

Tool references:

Run Rector to apply automated code refactoring. This command modifies files.

Terminal window
composer rector

Validate Rector without modifying files.

Terminal window
composer rector-check

Check coding standards without modifying files.

Terminal window
composer ecs-check

Apply coding standard fixes. This command modifies files.

Terminal window
composer ecs

Verify that runtime dependencies are correctly declared in composer.json.

Terminal window
composer check-dependencies

Run mutation testing.

Terminal window
composer mutation

Run mutation testing with static analysis enabled.

Terminal window
composer mutation-static

Make actionlint (and its ShellCheck helper), codespell, EditorConfig Checker, markdownlint-cli2, Prettier and yamllint available on PATH. Run all repository quality checks:

Terminal window
composer quality

Each tool can also be run separately:

Terminal window
composer actionlint
composer codespell
composer editorconfig-checker
composer markdownlint
composer prettier
composer yamllint

The codespell, EditorConfig Checker and Markdownlint configurations are in .github/linters. Prettier uses .prettierignore as its ignore path; yamllint checks .github.

Run static analysis.

Terminal window
composer static

Run the full test suite.

Terminal window
composer tests

Make zizmor and Gitleaks available on PATH. Run both checks, or either one separately:

Terminal window
composer security
composer zizmor
composer gitleaks

Zizmor uses the pedantic persona and may need GitHub API access for online audits. To request an offline audit:

Terminal window
composer zizmor -- --offline

Report offline limitations and hosted CI results separately. Gitleaks scans Git history with the repository’s configuration. Review findings instead of disabling the checks.

Composer scripts support forwarding additional arguments using --.

Run PHPUnit with code coverage report generation.

Terminal window
composer tests -- --coverage-html code_coverage

Run PHPStan with a different memory limit.

Terminal window
composer static -- --memory-limit=512M

Back to documentation