Completed
Push — 2.x-dev-kit ( 971030 )
by
unknown
07:52
created

SonataSeoExtensionTest::testBlocksLoading()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 19
rs 9.4285
cc 1
eloc 12
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\SeoBundle\Tests\DependencyInjection;
13
14
use Sonata\SeoBundle\DependencyInjection\SonataSeoExtension;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
17
/**
18
 * Tests SonataSeoExtension.
19
 *
20
 * @author Vincent Tommasi <[email protected]>
21
 */
22
class SonataSeoExtensionTest extends \PHPUnit_Framework_TestCase
23
{
24
    /**
25
     * Tests the loading of blocks.xml file.
26
     */
27
    public function testBlocksLoading()
28
    {
29
        $container = new ContainerBuilder();
30
        $container->setParameter('kernel.bundles', array(
31
            'SonataBlockBundle' => 'Sonata\BlockBundle\SonataBlockBundle',
32
            'KnpMenuBundle' => 'Knp\Bundle\MenuBundle\KnpMenuBundle',
33
        ));
34
35
        $extension = new SonataSeoExtension();
36
        $extension->load(array(array()), $container);
37
38
        $this->assertTrue($container->hasDefinition('sonata.seo.block.breadcrumb.homepage'));
39
40
        $container = new ContainerBuilder();
41
        $container->setParameter('kernel.bundles', array());
42
        $extension->load(array(array()), $container);
43
44
        $this->assertFalse($container->hasDefinition('sonata.seo.block.breadcrumb.homepage'));
45
    }
46
}
47