Moving reset database to parent class

parent 4e3e1527
......@@ -255,25 +255,4 @@ class EloquentFileRepositoryTest extends MediaTestCase
'folder_id' => 0,
]);
}
private function resetDatabase()
{
// Makes sure the migrations table is created
$this->artisan('migrate', [
'--database' => 'sqlite',
]);
// We empty all tables
$this->artisan('migrate:reset', [
'--database' => 'sqlite',
]);
// Migrate
$this->artisan('migrate', [
'--database' => 'sqlite',
]);
$this->artisan('migrate', [
'--database' => 'sqlite',
'--path' => 'Modules/Tag/Database/Migrations',
]);
}
}
......@@ -110,25 +110,4 @@ final class EloquentFolderRepositoryTest extends MediaTestCase
$this->assertEquals('/assets/media/root-folder/child-folder', $childFolder->path->getRelativeUrl());
$this->assertTrue($this->app['files']->isDirectory(public_path('assets/media/root-folder/child-folder')));
}
private function resetDatabase()
{
// Makes sure the migrations table is created
$this->artisan('migrate', [
'--database' => 'sqlite',
]);
// We empty all tables
$this->artisan('migrate:reset', [
'--database' => 'sqlite',
]);
// Migrate
$this->artisan('migrate', [
'--database' => 'sqlite',
]);
$this->artisan('migrate', [
'--database' => 'sqlite',
'--path' => 'Modules/Tag/Database/Migrations',
]);
}
}
......@@ -92,20 +92,4 @@ class FileTest extends MediaTestCase
'folder_id' => 0,
]);
}
private function resetDatabase()
{
// Makes sure the migrations table is created
$this->artisan('migrate', [
'--database' => 'sqlite',
]);
// We empty all tables
$this->artisan('migrate:reset', [
'--database' => 'sqlite',
]);
// Migrate
$this->artisan('migrate', [
'--database' => 'sqlite',
]);
}
}
......@@ -67,4 +67,25 @@ abstract class MediaTestCase extends TestCase
$app['config']->set('filesystems.disks.local.visibility', 'public');
$app['config']->set('filesystems.disks.local.root', base_path());
}
protected function resetDatabase()
{
// Makes sure the migrations table is created
$this->artisan('migrate', [
'--database' => 'sqlite',
]);
// We empty all tables
$this->artisan('migrate:reset', [
'--database' => 'sqlite',
]);
// Migrate
$this->artisan('migrate', [
'--database' => 'sqlite',
]);
$this->artisan('migrate', [
'--database' => 'sqlite',
'--path' => 'Modules/Tag/Database/Migrations',
]);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment