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.

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.