mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Remove database setup from single test.
This commit is contained in:
@@ -32,41 +32,6 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// if the database copy does not exist, call migrate.
|
|
||||||
$copy = __DIR__ . '/../storage/database/testing-copy.db';
|
|
||||||
$original = __DIR__ . '/../storage/database/testing.db';
|
|
||||||
|
|
||||||
FactoryMuffin::loadFactories(__DIR__ . '/factories');
|
|
||||||
|
|
||||||
if (!file_exists($copy)) {
|
|
||||||
touch($original);
|
|
||||||
Artisan::call('migrate');
|
|
||||||
|
|
||||||
|
|
||||||
// create EUR currency
|
|
||||||
/** @var TransactionCurrency $currency */
|
|
||||||
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
|
||||||
$currency->code = 'EUR';
|
|
||||||
$currency->save();
|
|
||||||
copy($original, $copy);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (file_exists($copy)) {
|
|
||||||
copy($copy, $original);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// if the database copy does exists, copy back as original.
|
|
||||||
|
|
||||||
$this->session(
|
|
||||||
[
|
|
||||||
'start' => Carbon::now()->startOfMonth(),
|
|
||||||
'end' => Carbon::now()->endOfMonth(),
|
|
||||||
'first' => Carbon::now()->startOfYear()
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,11 +51,6 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|||||||
public function tearDown()
|
public function tearDown()
|
||||||
{
|
{
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
|
|
||||||
// delete copy original.
|
|
||||||
//$original = __DIR__.'/../storage/database/testing.db';
|
|
||||||
//unlink($original);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user