Skip to content

Backend Test Environment Setup ​

Env Variables ​

Make a copy of .env.testing.example and save it as .env.testing. Make sure the following env variables are set correctly if you changed these values during installation of mysql or mariadb:

sh
DB_USERNAME=root
DB_PASSWORD=

MinIO ​

Integration tests require a valid MinIO configuration, since we use the s3 filesystems disk by default. Hence, make sure to set all the AWS environment values similar to the settings in your local development environment file.

Database Setup ​

The backend uses a MySQL database for integration testing. You need to create a database named test_emmie before running the tests.

MySQL client binaries ​

The Integration and Feature suites need the mysqldump and mysql executables on your PATH, on top of the database server itself. Both ship in mariadb-client (Fedora/Debian) or mysql-client; CI installs the same package (.github/workflows/ci.yml).

They are used on both sides of the tenant schema snapshot that keeps these suites fast:

BinaryUsed byWhen
mysqldumpschema:dump:allWriting database/schema/mysql-tenant-schema.sql
mysqltenant database creationLoading that file instead of replaying every tenant migration

Check both resolve:

sh
command -v mysqldump mysql

Missing either one fails loudly — Laravel's schema dumper/loader shells out through Symfony Process, so you get a process error naming the binary, not a silent fallback.

Coverage ​

To enable coverage support(the --coverage flag) with phpunit/pest, follow the guides for windows or fedora.

Troubleshooting ​

Out of memory ​

If you get an error about php unable to allocate enough memory, while running tests, make sure the memory_limit setting in your systems php.ini is set to at least 512M.