Passed
Push — master ( 9f6375...4086bc )
by WEBEWEB
06:28
created

SyntaxHighlighterExtensionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1
1
<?php
2
3
/**
4
 * This file is part of the syntaxhighligter-bundle package.
5
 *
6
 * (c) 2017 WEBEWEB
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 WBW\Bundle\SyntaxHighlighterBundle\Tests\DependencyInjection;
13
14
use PHPUnit_Framework_TestCase;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
17
use Symfony\Component\HttpKernel\KernelInterface;
18
use WBW\Bundle\SyntaxHighlighterBundle\DependencyInjection\SyntaxHighlighterExtension;
19
use WBW\Bundle\SyntaxHighlighterBundle\Twig\Extension\SyntaxHighlighterTwigExtension;
20
21
/**
22
 * SyntaxHighlighter extension test.
23
 *
24
 * @author webeweb <https://github.com/webeweb/>
25
 * @package WBW\Bundle\SyntaxHighlighterBundle\Tests\DependencyInjection
26
 * @final
27
 */
28
final class SyntaxHighlighterExtensionTest extends PHPUnit_Framework_TestCase {
29
30
    /**
31
     * Tests the load() method.
32
     *
33
     * @return void
34
     */
35
    public function testLoad() {
36
37
        // Set the mocks.
38
        $kernel = $this->getMockBuilder(KernelInterface::class)->getMock();
39
40
        // We set a container builder with only the necessary.
41
        $container = new ContainerBuilder(new ParameterBag(["kernel.environment" => "dev"]));
42
        $container->set("kernel", $kernel);
43
44
        $obj = new SyntaxHighlighterExtension();
45
46
        $obj->load([], $container);
47
        $this->assertInstanceOf(SyntaxHighlighterTwigExtension::class, $container->get(SyntaxHighlighterTwigExtension::SERVICE_NAME));
48
    }
49
50
}
51