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

BaseIntegrationTest::getRepositoryTemplatePath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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