Skip to content

Commit

Permalink
Added the migrations to the base test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
ash-jc-allen committed Apr 18, 2021
1 parent 4b23ec9 commit 9b8b96d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/Unit/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,27 @@ protected function getEnvironmentSetUp($app)
'driver' => 'sqlite',
'database' => ':memory:',
]);

$this->migrateDatabase();
}

/**
* Include each of the migrations and migrate them to
* finish preparing the database for running the
* tests.
*/
private function migrateDatabase(): void
{
include_once __DIR__.'/../../database/migrations/2019_12_22_015115_create_short_urls_table.php';
include_once __DIR__.'/../../database/migrations/2019_12_22_015214_create_short_url_visits_table.php';
include_once __DIR__.'/../../database/migrations/2020_02_11_224848_update_short_url_table_for_version_two_zero_zero.php';
include_once __DIR__.'/../../database/migrations/2020_02_12_008432_update_short_url_visits_table_for_version_two_zero_zero.php';
include_once __DIR__.'/../../database/migrations/2020_04_10_224546_update_short_url_table_for_version_three_zero_zero.php';

(new \CreateShortUrlsTable)->up();
(new \CreateShortUrlVisitsTable)->up();
(new \UpdateShortURLTableForVersionTwoZeroZero)->up();
(new \UpdateShortURLVisitsTableForVersionTwoZeroZero)->up();
(new \UpdateShortURLTableForVersionThreeZeroZero)->up();
}
}

0 comments on commit 9b8b96d

Please sign in to comment.