php tests/run.php # everything
php tests/run.php Gallery # just files matching GalleryA file in tests/Modules/ returns an array:
return [
'a draft is not live' => static function (): void {
assertFalse($service->isLive($draft));
},
];Helpers are assertTrue, assertFalse, assertSame and assertThrows.
🚨 Tests run against a real database and share it. Mark everything you create with a distinctive prefix, and clean up in a finally so a failing assertion does not leave rows behind for the next test to trip over.
🚨 Do not depend on ambient data. A test that counts rows matching widget-person also matched widget-person-name, and passed only while the site had fewer than fifteen members. Importing a real site broke it.