Testing
| Suite | Where | What it covers |
|---|---|---|
PHPUnit unit | tests/Unit (mirrors src) | Each class alone, EasyAdmin's DTOs and contexts built for testing. |
PHPUnit functional | tests/Functional | The bundle inside the test application: placeholders, fragments, session release, every option changed. |
PHPUnit tools | tests/Tools | The release tool. |
| Vitest | tests/vitest (mirrors assets) | The script under jsdom, at 100% of statements, branches, functions and lines. |
| Playwright | tests/playwright | The test application in Chromium: loading, pagination and sorting in place, a list URL opened alone, a delete in place followed by a save, a cancelled page confirmation. |
The test application
tests/Application is a small EasyAdmin application on SQLite: authors, their books (a mapped OneToMany), the books' reviews, and Author::$reviews, a computed collection. Ada has five books, three to a page; Grace has one. The edit page of an author also has a Delete action, for the cancelled-confirmation scenario.
- The functional tests boot its kernel with the bundle configuration their class returns from
bundleConfig(); each configuration gets its own container and database undervar/application/. make e2einstalls EasyAdmin's assets, recreates thee2edatabase and runs Playwright, which serves the application with PHP's built-in server on port 8740. Each scenario recreates the data first.make serveserves it for a look in your browser (admin/admin).
Coverage and mutations
make coverage requires 100% of PHP statements and methods (tests/bin/check-coverage.php reads the Clover report) and 100% of every Vitest metric. make infection requires a mutation score of 100%; the few equivalent mutants carry an @infection-ignore-all comment naming why no test can tell them apart.