test
Run tests with smart scoping by module, file, or filter
SKILL.md.claude/skills/test/SKILL.md
GitHubTest Runner
Run the minimum scope for what changed. Prefer narrow over broad.
| Changed | Command |
|---|---|
| One module | vendor/bin/phpunit tests/Unit/<Module>/ |
| One class | vendor/bin/phpunit --filter <ClassName> |
| One behavior | vendor/bin/phpunit --filter test_method_name |
| HTTP / DB code | vendor/bin/phpunit --testsuite=feature |
| Types only | composer phpstan |
| Anything before commit | composer test |
Available scripts:
composer test # phpstan + phpunit — the gate
composer phpunit # tests only
composer phpstan # static analysis only
composer test:coverage # HTML coverage into local/coverage
Instructions
- Empty
$ARGUMENTSorall→composer test quick→vendor/bin/phpunit --testsuite=unit(skip phpstan and feature suite)unit/feature→vendor/bin/phpunit --testsuite=$ARGUMENTSphpstan→composer phpstancoverage→composer test:coverage- A module name (
Chat,Payment, …) →vendor/bin/phpunit tests/Unit/<Module>/ - A path →
vendor/bin/phpunit "$ARGUMENTS" - Anything else →
vendor/bin/phpunit --filter "$ARGUMENTS"
Report pass/fail counts. On failure, quote the assertion verbatim and name the file:line — do not paraphrase the error.