IntegrationTestAbstract::prepareTestDb()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Hgraca\MicroDbal\Test;
4
5
use PHPUnit_Framework_TestCase;
6
7
abstract class IntegrationTestAbstract extends PHPUnit_Framework_TestCase
8
{
9
    /** @var string */
10
    private $rootDir;
11
12
    /**
13
     * @before
14
     */
15
    public function prepareTestDb()
16
    {
17
        copy(__DIR__ . '/northwind.sqlite', $this->getTestDbPath());
18
    }
19
20
    protected function getRootDir(): string
21
    {
22
        return $this->rootDir ?? $this->rootDir = ROOT_DIR;
23
    }
24
25
    protected function getTestDbPath(): string
26
    {
27
        return $this->getRootDir() . '/var/tmp/northwind.sqlite';
28
    }
29
}
30