Guidelines for running tests, static analysis, and contributing to QuillPHP.
QuillPHP uses Pest for all testing.
# Run the full test suite
composer test
# Run with verbose output
vendor/bin/pest --verbose
# Run a specific test file
vendor/bin/pest tests/Unit/Routing/RouterTest.phpTests are split into two layers:
| Suite | Path | Covers |
|---|---|---|
| Unit | tests/Unit/ |
Individual classes in isolation |
| Feature | tests/Feature/ |
End-to-end request/response flows |
| File | What it tests |
|---|---|
Unit/Routing/RouterTest.php |
Route compilation, matching, parameters |
Unit/Runtime/RuntimeTest.php |
FFI boot, init, availability flag |
Unit/Runtime/JsonTest.php |
Json::encode / Json::decode round-trips |
Unit/Validation/ValidatorTest.php |
DTO reflection, schema registration, validation |
Unit/Http/RequestTest.php |
Request parsing and accessors |
| File | What it tests |
|---|---|
AppTest.php |
Full app lifecycle and route dispatch |
CacheTest.php |
Cache driver behaviour |
ContainerTest.php |
DI container resolution |
CorsTest.php |
CORS preflight and header injection |
DatabaseTest.php |
Database abstraction layer |
MiddlewareTest.php |
Pipeline execution and ordering |
OpenApiTest.php |
OpenAPI spec generation |
SecurityTest.php |
Security header middleware |
QuillPHP targets PHPStan level 9:
composer analyze
# or
vendor/bin/phpstan analyse --no-progressAll @phpstan-ignore-next-line annotations must include a brief justification comment.
Run the HTTP benchmark suite locally (requires wrk):
# macOS
brew install wrk
# Run default benchmark (5s, 50 connections, 2 workers)
composer bench
# Custom parameters
DURATION=30 CONNECTIONS=200 THREADS=8 composer bench- Fork the repository and create a feature branch from
main. - Implement your changes, keeping the hot path free of reflection and object allocation.
- Write tests — all new behaviour must be covered by Pest tests.
- Pass all checks:
composer testandcomposer analyzemust both succeed. - Benchmark — run
composer benchbefore and after; performance regressions on the hot path require justification. - Open a pull request against
main. The PR description must include the## Checklistsection from the template.
QuillPHP is released under the MIT License. See LICENSE for details.