This package provides a consistent set of Composer scripts for local validation. Install the development dependencies first:
composer installTool references:
- Actionlint for GitHub Actions workflow linting.
- Codespell for spelling checks.
- Composer Require Checker for dependency definition checks.
- Easy Coding Standard (ECS) for coding standards.
- EditorConfig Checker for EditorConfig compliance.
- Gitleaks for secret scanning.
- Infection for mutation testing.
- Markdownlint-cli2 for Markdown linting.
- PHPStan for static analysis.
- Prettier for Markdown and YAML formatting checks.
- Rector for automated refactoring.
- Testo for unit, functional and real-Composer tests.
- Yamllint for YAML linting.
- Zizmor for GitHub Actions security audits.
The Testo configuration lives in testo.php and defines two suites:
Unitreadstests/withouttests/Composer,tests/Fixtures,tests/Providerandtests/Support. It holds the unit, command and functional tests, which run in the current process.Composerreadstests/Composer. It runs a real Composer binary in subprocesses against temporary projects (see Real Composer tests).
Both suites fail a test on any PHP warning, notice or deprecation, and on a test without assertions
(tests/Support/StrictTestPlugin.php). Filesystem failures are exercised against the real filesystem (a directory where
a file is expected, a regular file as a parent directory, a missing source, chmod 0000), without function mocks; the
chmod cases are skipped on Windows and when running as root.
Run Rector to apply automated code refactoring. This command modifies files.
composer rectorPreview the refactoring without modifying files.
composer rector -- --dry-runCheck coding standards without modifying files.
vendor/bin/ecs checkApply coding standard fixes. Review the changes before keeping them.
composer ecsVerify that runtime dependencies are correctly declared in composer.json.
composer check-dependenciesRun mutation testing with PHPStan static analysis enabled. Infection runs the Unit suite through
testo/bridge-infection. This is the command CI runs.
composer mutation-staticRun mutation testing without static analysis.
composer mutationBoth runs reach the required score without ignored mutants. Thresholds, thread count and memory options live in
infection.json5; the package requires a 100 % mutation score indicator (MSI) and covered MSI. The Composer suite is
left out because its subprocesses install a snapshot of the working tree instead of running the mutated code.
The quality workflow runs Actionlint and uses the repository configurations for Codespell, EditorConfig Checker,
Markdownlint-cli2, Prettier and Yamllint. The security workflow runs Zizmor with its pedantic persona and Gitleaks
with the repository configuration. These checks are not exposed as Composer scripts in this package; run the individual
tools directly with the checked-in configuration when reproducing a hosted check locally.
Report hosted workflow execution separately from local commands. Keep generated reports in ignored internal/ or
runtime/ paths.
Run static analysis at level max with the strict checks from phpstan.neon. The Composer script removes the PHP memory
limit.
composer staticRun both suites.
composer testsRun only the Unit suite.
composer tests-unitCI runs the suites on PHP 8.3, 8.4 and 8.5, on Ubuntu and Windows, and uploads the coverage to Codecov.
The Composer suite covers the plugin lifecycle and the provider integration that an in-process test cannot reproduce:
composer install, update and create-project against a snapshot of this working tree and a provider fixture,
offline. The harness uses the COMPOSER_BINARY environment variable when set; otherwise it looks for composer.phar
and then composer on PATH. When none is available, every test of the suite is skipped.
Run only this suite:
composer tests -- --suite=ComposerRun it with a specific Composer PHAR:
COMPOSER_BINARY=/path/to/composer.phar composer tests -- --suite=ComposerFilter the tests by class or method name (the match is case-sensitive), and print a single JSON summary with the failed tests instead of the terminal report.
vendor/bin/testo --json --filter=ScaffolderTestCollect coverage with PCOV or Xdebug enabled and write a Clover XML report.
composer tests-unit -- --coverage-clover=runtime/clover.xmlComposer scripts forward additional arguments after --.
Run PHPStan with debug output.
composer static -- --debug