BaseIntegrationTest::loadKernelAndFixtures()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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
    /**
18
     * {@inheritdoc}
19
     */
20
    protected function setUp(): void
21
    {
22
        $this->setUpRepo();
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function tearDown(): void
29
    {
30
        $this->tearDownRepo();
31
    }
32
33
    protected function loadKernelAndFixtures(array $classNames = []): ReferenceRepository
34
    {
35
        self::bootKernel();
36
        return $this->loadFixtures($classNames)->getReferenceRepository();
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    protected function getRepositoryTemplatePath()
43
    {
44
        return realpath(__DIR__ . '/../../vendor/dontdrinkandroot/gitki-bundle/Tests/Data/repo/');
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    protected function getRepositoryTargetPath()
51
    {
52
        return self::GIT_REPOSITORY_PATH;
53
    }
54
}
55