IntegrationTestAbstract   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 23
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A prepareTestDb() 0 4 1
A getRootDir() 0 4 1
A getTestDbPath() 0 4 1
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