Completed
Push — master ( 902133...f13570 )
by Philip
23:54
created

BaseIntegrationTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 3
dl 0
loc 41
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A tearDown() 0 4 1
A loadKernelAndFixtures() 0 7 1
A getRepositoryTemplatePath() 0 4 1
A getRepositoryTargetPath() 0 4 1
1
<?php
2
3
namespace App\Tests\Integration;
4
5
use Doctrine\Common\DataFixtures\ReferenceRepository;
6
use Dontdrinkandroot\GitkiBundle\Tests\GitRepositoryTestTrait;
7
use Liip\TestFixturesBundle\Test\FixturesTrait;
8
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
9
10
abstract class BaseIntegrationTest extends WebTestCase
11
{
12
    use GitRepositoryTestTrait;
13
    use FixturesTrait;
14
15
    const GIT_REPOSITORY_PATH = '/tmp/gitkirepo/';
16
17
    protected function setUp()
18
    {
19
        $this->setUpRepo();
20
    }
21
22
    public function tearDown(): void
23
    {
24
        $this->tearDownRepo();
25
    }
26
27
    protected function loadKernelAndFixtures(array $classNames = []): ReferenceRepository
28
    {
29
        self::bootKernel();
30
        $referenceRepository = $this->loadFixtures($classNames)->getReferenceRepository();
31
32
        return $referenceRepository;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    protected function getRepositoryTemplatePath()
39
    {
40
        return realpath(__DIR__ . '/../../vendor/dontdrinkandroot/gitki-bundle/Tests/Data/repo/');
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    protected function getRepositoryTargetPath()
47
    {
48
        return self::GIT_REPOSITORY_PATH;
49
    }
50
}
51