lundi 7 septembre 2020

Tests in Laravel - run database migrations just once per file, rather than for every individual test

In my Laravel application I have a large number of MySql tables and a large number of phpunit tests to run. I run tests in memory using Sqlite and have a series of Seeder files to add data to the test database.

For each test, Laravel creates a new database, runs the migrations and adds the data which takes a lot of time when multiplied by the number of tests.

I would like to specify that for some test files, the RefreshDatabase and DatabaseMigrations only needs to run once per file, not once per test.

Is that feature available in Laravel?

Aucun commentaire:

Enregistrer un commentaire