Completed
Push — master ( f05406...a33308 )
by Maximilian
15s
created

testDocumentTreeDefaultValues()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 40
Code Lines 28

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 40
rs 8.8571
c 1
b 0
f 1
cc 1
eloc 28
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\DoctrinePHPCRAdminBundle\Tests\DependencyInjection;
13
14
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
15
use Sonata\DoctrinePHPCRAdminBundle\DependencyInjection\SonataDoctrinePHPCRAdminExtension;
16
17
class SonataDoctrinePHPCRAdminExtensionTest extends AbstractExtensionTestCase
18
{
19
    public function getContainerExtensions()
20
    {
21
        return array(
22
           new SonataDoctrinePHPCRAdminExtension(),
23
        );
24
    }
25
26
    public function testDocumentTreeDefaultValues()
27
    {
28
        $this->container->setParameter(
29
            'kernel.bundles',
30
            array()
31
        );
32
        $this->load(array('document_tree' => array()));
33
34
        $this->assertContainerBuilderHasParameter(
35
            'sonata_admin_doctrine_phpcr.tree_block.configuration',
36
            array(
37
                'routing_defaults' => array(),
38
                'repository_name' => null,
39
                'sortable_by' => 'position',
40
                'move' => true,
41
                'reorder' => true,
42
            )
43
        );
44
45
        $this->assertContainerBuilderHasParameter(
46
            'sonata_admin_doctrine_phpcr.tree_block.routing_defaults',
47
            array()
48
        );
49
        $this->assertContainerBuilderHasParameter(
50
            'sonata_admin_doctrine_phpcr.tree_block.repository_name',
51
            null
52
        );
53
        $this->assertContainerBuilderHasParameter(
54
            'sonata_admin_doctrine_phpcr.tree_block.sortable_by',
55
            'position'
56
        );
57
        $this->assertContainerBuilderHasParameter(
58
            'sonata_admin_doctrine_phpcr.tree_block.move',
59
            true
60
        );
61
        $this->assertContainerBuilderHasParameter(
62
            'sonata_admin_doctrine_phpcr.tree_block.reorder',
63
            true
64
        );
65
    }
66
}
67