pgsql to repopulate database instead of Db module
You may have seen that Db module is quite slow when loading large database dumps. It also fails in parsing complex SQLs. It is quite a good idea to leave
tests/_data/dump.sql to be empty file and leave
cleanup option of Db module enabled, so database will be cleaned up before each test, yet dump not to be loaded. We will use
realdump.sql file to populate database.
To load dump before each test you can use
AcceptanceHelper or any other Helper class you have. Probably you will need to create your own helper with
codecept g:helper DbHelper command.
In its before method you can load db dump (using
mysql in this example)
public function _before(\Codeception\TestCase $test)
exec("mysql -u user -ppassword testdb < tests/_data/real_dump.sql");
Alternativly you can turn off
cleanup option and add instructions for cleaning the database into your dumpfile.