Skip to main content
ARUKZ ERP is tested with Pest 4 feature tests that build a complete ERP in a test database before the first test. Run them serially, one test process per database, with 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

Run whole folders rather than single files: each test process first rebuilds the whole ERP (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.
  • One process per database. Two test runs against the same database rebuild it under each other and fail in confusing ways. Give each parallel runner its own database.
  • Do not edit PHP files during a run. The process loads code as it goes, so an edit mid-run mixes old and new code.
  • Do not use php artisan test for a full run. It starts Pest under PHP’s default 512 MB limit; a full run outgrows it near the end and the process dies without printing a summary, hiding any failures.

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:
Heavy test runs load the database server. Run them in CI or on a machine that does not also serve customers.

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.
Build a custom plugin shows these for a new module.
Last modified on November 12, 2026