mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-30 21:53:28 +08:00
35 lines
896 B
Markdown
35 lines
896 B
Markdown
---
|
|
paths:
|
|
- "**/*.php"
|
|
- "**/phpunit.xml"
|
|
- "**/phpunit.xml.dist"
|
|
- "**/composer.json"
|
|
---
|
|
# PHP Testing
|
|
|
|
> This file extends [common/testing.md](../common/testing.md) with PHP specific content.
|
|
|
|
## Framework
|
|
|
|
Use **PHPUnit** as the default test framework. **Pest** is also acceptable when the project already uses it.
|
|
|
|
## Coverage
|
|
|
|
```bash
|
|
vendor/bin/phpunit --coverage-text
|
|
# or
|
|
vendor/bin/pest --coverage
|
|
```
|
|
|
|
Prefer **pcov** or **Xdebug** in CI, and keep coverage thresholds in CI rather than as tribal knowledge.
|
|
|
|
## Test Organization
|
|
|
|
- Separate fast unit tests from framework/database integration tests.
|
|
- Use factory/builders for fixtures instead of large hand-written arrays.
|
|
- Keep HTTP/controller tests focused on transport and validation; move business rules into service-level tests.
|
|
|
|
## Reference
|
|
|
|
See skill: `tdd-workflow` for the repo-wide RED -> GREEN -> REFACTOR loop.
|