Completed
Push — master ( bacf03...74d4a3 )
by amaury
05:06 queued 01:51
created

BlockRepositoryTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace OpenOrchestra\FunctionalTests\ModelBundle\Repository;
4
5
use OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractKernelTestCase;
6
use OpenOrchestra\ModelBundle\Repository\BlockRepository;
7
8
/**
9
 * Class BlockRepositoryTest
10
 *
11
 * @group integrationTest
12
 */
13
class BlockRepositoryTest extends AbstractKernelTestCase
14
{
15
    /**
16
     * @var BlockRepository
17
     */
18
    protected $repository;
19
20
    /**
21
     * Set up test
22
     */
23
    protected function setUp()
24
    {
25
        parent::setUp();
26
27
        static::bootKernel();
28
        $this->repository = static::$kernel->getContainer()->get('open_orchestra_model.repository.block');
29
    }
30
31
    /**
32
     * @param int    $count
33
     * @param string $component
34
     * @param string $language
35
     * @param string $siteId
36
     *
37
     * @dataProvider provideLanguageAndVersionListAndSiteId
38
     */
39
    public function testFindTransverseBlock($count, $component, $language, $siteId)
40
    {
41
        $blocks = $this->repository->findTransverseBlock($component, $siteId, $language);
42
        $this->assertCount($count, $blocks);
43
    }
44
45
    /**
46
     * @return array
47
     */
48
    public function provideLanguageAndVersionListAndSiteId()
49
    {
50
        return array(
51
            array(0,'fake_component', 'en', '2'),
52
            array(2, 'tiny_mce_wysiwyg', 'fr', '2'),
53
            array(2, 'tiny_mce_wysiwyg', 'en', '2'),
54
            array(1, 'menu', 'en', '2'),
55
        );
56
    }
57
}
58