Pular para o conteúdo
PHP Ecosystem
Explore

Testing

Este conteúdo não está disponível em sua língua ainda.

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

Preview the refactoring without modifying files.

Terminal window
composer rector-check

Check coding standards without modifying files.

Terminal window
composer ecs-check

Apply coding standard fixes. Review the changes before keeping them.

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

Run static analysis.

Terminal window
composer static

Run the full test suite.

Terminal window
composer tests

Make the CLI tools used by the shared PHP Forge quality workflow available on PATH: actionlint with ShellCheck, codespell, EditorConfig Checker, markdownlint-cli2, Prettier, and yamllint.

Terminal window
composer quality

Each check also has its own script.

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

Linter configuration lives in .github/linters. Prettier uses its default configuration without repository-specific configuration or ignore files. CI uses the same configuration choices; tool versions can differ locally.

Make zizmor and Gitleaks available on PATH. Run both checks with the same pedantic persona and Gitleaks configuration used by CI.

Terminal window
composer security

Each tool also has its own script. Zizmor uses GitHub API access for online audits; an explicit offline check is available.

Terminal window
composer zizmor -- --offline
composer gitleaks

Report hosted CI execution and its PHP/OS matrix separately from local checks. Keep generated maintainer reports in ignored internal/.

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 Usage examples