Skip to content

Testing ​

SuiteWhereWhat it covers
PHPUnit unittests/Unit (mirrors src)Each class alone, EasyAdmin's DTOs and contexts built for testing.
PHPUnit functionaltests/FunctionalThe bundle inside the test application: placeholders, fragments, session release, every option changed.
PHPUnit toolstests/ToolsThe release tool.
Vitesttests/vitest (mirrors assets)The script under jsdom, at 100% of statements, branches, functions and lines.
Playwrighttests/playwrightThe 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 under var/application/.
  • make e2e installs EasyAdmin's assets, recreates the e2e database and runs Playwright, which serves the application with PHP's built-in server on port 8740. Each scenario recreates the data first.
  • make serve serves 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.

Released under the MIT License.