protected function setUp() {
parent::setUp();
$this->artisan('migrate');
(new \DatabaseSeeder())->call(\DatabaseSeeder::class);
}
I have this in my parent TestClass which migrates and seeds the db before every test. But the echo output always appears after the tests have finished. Does this mean the seeding hasnt finished before the test starts to run. Coincidentally the tests fail because my account doesnt have the right permissions, which is what the seeding is for.
So I believe the issue was to do with me not specifying which database to seed. So the test database never got seeded. So the tests failed. However, from a performance stand point, because of the sheer amount of data that needs to be seeded. It became more practical to create a file based sqlite database and then seed that first, and then run all of the tests on that using db transactions.
Cheers for all of your assistance. As always, you are fantastic :)