php -d memory_limit=-1 vendor/bin/pest (what composer test does), and only against a database whose name contains test: the suite runs migrate:fresh and would wipe anything else, so it refuses to start.
Run a suite
migrate:fresh, erp:install and every plugin), which takes about 10 to 12 minutes before the first test runs. A full run of every suite takes about two hours.
The test database
phpunit.xml sets DB_DATABASE=aureus_testing. tests/TestCase.php refuses to run against a database whose name does not contain test, unless DB_ALLOW_DESTRUCTIVE_TESTS=true says it is disposable (a throwaway CI container, for example).
If the application has its config cached (as production does), a test process would read the cached settings instead of phpunit.xml. Point it at empty cache files so it reads phpunit.xml without clearing the live caches:
Which suites matter
What a new feature should add
- An isolation test: a record made in company A is not returned to a user of company B.
- A permission test: a role without the permission cannot open the screen or call the action.
- For anything with a number series, a test that two companies can both start at
0001.