Completed
Push — master ( 402c8e...a49823 )
by Philip
22:11
created

BaseIntegrationTest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 6
c 0
b 0
f 0
lcom 1
cbo 4
dl 0
loc 63
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getKernelClass() 0 4 1
A setUp() 0 7 1
A tearDown() 0 4 1
A getReference() 0 4 1
A getRepositoryTemplatePath() 0 4 1
A getRepositoryTargetPath() 0 4 1
getFixtureClasses() 0 1 ?
1
<?php
2
3
namespace App\Tests\Integration;
4
5
use Doctrine\Common\DataFixtures\Executor\ORMExecutor;
6
use Doctrine\Common\DataFixtures\ReferenceRepository;
7
use Dontdrinkandroot\GitkiBundle\Tests\GitRepositoryTestTrait;
8
use Liip\FunctionalTestBundle\Test\WebTestCase;
9
10
abstract class BaseIntegrationTest extends WebTestCase
11
{
12
    use GitRepositoryTestTrait;
13
14
    const GIT_REPOSITORY_PATH = '/tmp/gitkirepo/';
15
16
    /**
17
     * @var ReferenceRepository
18
     */
19
    protected $referenceRepository;
20
21
    /**
22
     * {@inheritdoc}
23
     */
24
    protected static function getKernelClass()
25
    {
26
        return getenv('KERNEL_CLASS');
27
    }
28
29
    protected function setUp()
30
    {
31
        /** @var ORMExecutor $executor */
32
        $executor = $this->loadFixtures($this->getFixtureClasses());
33
        $this->referenceRepository = $executor->getReferenceRepository();
34
        $this->setUpRepo();
35
    }
36
37
    public function tearDown()
38
    {
39
        $this->tearDownRepo();
40
    }
41
42
    /**
43
     * @param string $name
44
     *
45
     * @return object
46
     */
47
    protected function getReference($name)
48
    {
49
        return $this->referenceRepository->getReference($name);
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55
    protected function getRepositoryTemplatePath()
56
    {
57
        return realpath(__DIR__ . '/../../vendor/dontdrinkandroot/gitki-bundle/Tests/Data/repo/');
58
    }
59
60
    /**
61
     * {@inheritdoc}
62
     */
63
    protected function getRepositoryTargetPath()
64
    {
65
        return self::GIT_REPOSITORY_PATH;
66
    }
67
68
    /**
69
     * @return string[]
70
     */
71
    abstract protected function getFixtureClasses();
72
}
73