GimmeExtensionTest::testConstructor()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Templates System.
5
 *
6
 * Copyright 2015 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2015 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Component\TemplatesSystem\Tests\Twig\Extension;
16
17
use Doctrine\Common\Cache\ArrayCache;
18
use SWP\Component\TemplatesSystem\Gimme\Context\Context;
19
use SWP\Component\TemplatesSystem\Gimme\Factory\MetaFactory;
20
use SWP\Component\TemplatesSystem\Gimme\Loader\ArticleLoader;
21
use SWP\Component\TemplatesSystem\Twig\Extension\GimmeExtension;
22
use Symfony\Component\EventDispatcher\EventDispatcher;
23
24
class GimmeExtensionTest extends \PHPUnit\Framework\TestCase
25
{
26
    public function testConstructor()
27
    {
28
        $context = new Context(new EventDispatcher(), new ArrayCache());
29
        $loader = new ArticleLoader(__DIR__.'/Node/Resources/meta', new MetaFactory($context));
30
31
        $gimmeExtension = new GimmeExtension($context, $loader);
32
        self::assertEquals($gimmeExtension->getContext(), $context);
33
        self::assertEquals($gimmeExtension->getLoader(), $loader);
34
        self::assertEquals($gimmeExtension->getGlobals(), ['gimme' => $context]);
35
    }
36
}
37