Completed
Push — master ( af9685...cffdd8 )
by Philip
03:38
created

BaseIntegrationTest::getRepositoryDataPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
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
14
    use GitRepositoryTestTrait;
15
16
    const GIT_REPOSITORY_PATH = '/tmp/gitkirepo/';
17
18
    /**
19
     * @var ReferenceRepository
20
     */
21
    protected $referenceRepository;
22
23
    protected function setUp()
24
    {
25
        /** @var ORMExecutor $executor */
26
        $executor = $this->loadFixtures($this->getFixtureClasses());
27
        $this->referenceRepository = $executor->getReferenceRepository();
28
        $this->setUpRepo();
29
    }
30
31
    public function tearDown()
32
    {
33
        $this->tearDownRepo();
34
    }
35
36
    /**
37
     * @param string $name
38
     *
39
     * @return object
40
     */
41
    protected function getReference($name)
42
    {
43
        return $this->referenceRepository->getReference($name);
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    protected function getRepositoryDataPath()
50
    {
51
        return realPath(__DIR__ . '/../../../../vendor/dontdrinkandroot/gitki-bundle/Tests/Data/repo/');
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    protected function getRepositoryTargetPath()
58
    {
59
        return self::GIT_REPOSITORY_PATH;
60
    }
61
62
    /**
63
     * @return string[]
64
     */
65
    abstract protected function getFixtureClasses();
66
}
67