I've currently got 44 tests (mostly acceptance-test types), and each test is taking several minutes to run. If what I think I'm seeing is what's really going on, phpunit is migrating, seeding, and then deleting the db for each test. Is this what should be happening? My tests are painfully slow (several minutes each at least), but if it's running the migration, that would be why. (It's slow, and I haven't bothered to fix that yet.) Moving to sqlite improved things to the point that I don't ctrl-c out of the process in frustration, but not enough that I could keep doing this without wanting to throw my computer out the window. So, is it/should it be migrating for every single test? Is there a way to make it not do that but just do it for each run of phpunit? If I know it's just going to take a few minutes to start up, that bothers me a lot less than a few minutes for Every. Single. Test.
ETA: In more digging, it looks like I'm calling the migrate and seed each time by using this in my TestCase.php file:
public function setUp()
{
parent::setUp();
Artisan::call('migrate', [
'--env' => 'testing',
"--database" => "sqlite"
]);
Artisan::call('db:seed');
}
public function tearDown()
{
Artisan::call('migrate:reset');
parent::tearDown();
}
Rather than do that for each test, can I put these commands somewhere else so that I start phpunit, it runs the migration and seeding once, then does all the tests?