Testing
Цей контент ще не доступний вашою мовою.
This package provides a consistent set of Composer scripts for local validation.
Tool references:
- Composer Require Checker for dependency definition checks.
- Easy Coding Standard (ECS) for coding standards.
- Infection for mutation testing.
- PHPStan for static analysis.
- PHPUnit for unit tests.
- Rector for automated refactoring.
Worker lifecycle tests
Section titled “Worker lifecycle tests”phpunit.xml.dist loads the package’s internal-function mocks. The suite uses the real bridge lifecycle and a
deterministic Yii response. It verifies request limits, HEAD body suppression, emission before after-send,
successive requests, failed emission/conversion, and finalization once when after-send throws.
These tests run under PHP CLI; they do not start FrankenPHP. To verify a deployment, use the quick start with the installed runtime and run the migration checks. Check native request reset, session isolation, upload reset, HEAD headers/body, partial-download bytes, and worker restarts. Record the runtime version and distinguish this evidence from mocked unit results.
Documentation checks
Section titled “Documentation checks”Run the installed format tools over edited guides and skill files:
markdownlint-cli2 --config .github/linters/.markdown-lint.yml \ README.md UPGRADE.md AGENTS.md 'docs/*.md' 'skills/**/SKILL.md'prettier --check README.md UPGRADE.md AGENTS.md 'docs/*.md' 'skills/**/SKILL.md'editorconfig-checkerAutomated refactoring (Rector)
Section titled “Automated refactoring (Rector)”Run Rector to apply automated code refactoring.
composer rectorCoding standards (ECS)
Section titled “Coding standards (ECS)”Run Easy Coding Standard (ECS) and apply fixes.
composer ecsDependency definition check
Section titled “Dependency definition check”Verify that runtime dependencies are correctly declared in composer.json.
composer check-dependenciesMutation testing (Infection)
Section titled “Mutation testing (Infection)”Run mutation testing.
composer mutationRun mutation testing with static analysis enabled.
composer mutation-staticStatic analysis (PHPStan)
Section titled “Static analysis (PHPStan)”Run static analysis.
composer staticUnit tests (PHPUnit)
Section titled “Unit tests (PHPUnit)”Run the full test suite.
composer testsPassing extra arguments
Section titled “Passing extra arguments”Composer scripts support forwarding additional arguments using --.
Run PHPUnit with code coverage report generation.
composer tests -- --coverage-html code_coverageRun PHPStan with a different memory limit.
composer static -- --memory-limit=512M