GimmeExtensionTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 7
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testConstructor() 0 10 1
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