Skip to content

Setup

If you run your tests using PHPUnit and thus use one process, make sure you have a database named smarthealth_test and a smarthealth user that has access to it.

If you run tests in parallel, ensure your database user has the necessary permissions to manage all databases.

Route permission tests

The UntestedRoutesRoutePermissionTest in tests/Routes asserts that there are no routes left untested. To be able to know which routes are tested, we need to generate this list of routes before running PHPUnit tests, and outside of that command too. The reason for this is that with Paratest, it's impossible to access one test in another or use Reflection on it.

To work around that, the composer run-script test:php command also runs php artisan test:routes:generate which generates this list in storage/tests/testedPermissionRoutes.php. If you want to run that test (or all tests), be sure to use the Composer script for this or run the command first. If you make changes to a route permission test or add a new one, also run the generate command before running UntestedRoutesRoutePermissionTest.