Completed
Push — master ( 8cf454...7dc3cc )
by Philip
21:50
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
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
4
namespace Dontdrinkandroot\Gitki\WebBundle\Tests\Integration;
5
6
use Doctrine\Common\DataFixtures\Executor\ORMExecutor;
7
use Doctrine\Common\DataFixtures\ReferenceRepository;
8
use Dontdrinkandroot\GitkiBundle\Tests\GitRepositoryTestTrait;
9
use Liip\FunctionalTestBundle\Test\WebTestCase;
10
11
abstract class BaseIntegrationTest extends WebTestCase
12
{
13
    use GitRepositoryTestTrait;
14
15
    const GIT_REPOSITORY_PATH = '/tmp/gitkirepo/';
16
17
    /**
18
     * @var ReferenceRepository
19
     */
20
    protected $referenceRepository;
21
22
    protected function setUp()
23
    {
24
        /** @var ORMExecutor $executor */
25
        $executor = $this->loadFixtures($this->getFixtureClasses());
26
        $this->referenceRepository = $executor->getReferenceRepository();
27
        $this->setUpRepo();
28
    }
29
30
    public function tearDown()
31
    {
32
        $this->tearDownRepo();
33
    }
34
35
    /**
36
     * @param string $name
37
     *
38
     * @return object
39
     */
40
    protected function getReference($name)
41
    {
42
        return $this->referenceRepository->getReference($name);
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    protected function getRepositoryTemplatePath()
49
    {
50
        return realpath(__DIR__ . '/../../../../vendor/dontdrinkandroot/gitki-bundle/Tests/Data/repo/');
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    protected function getRepositoryTargetPath()
57
    {
58
        return self::GIT_REPOSITORY_PATH;
59
    }
60
61
    /**
62
     * @return string[]
63
     */
64
    abstract protected function getFixtureClasses();
65
}
66