Completed
Push — master ( bf375b...cc5661 )
by Rafał
07:07
created

GimmeExtensionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 6
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
23
class GimmeExtensionTest extends \PHPUnit_Framework_TestCase
24
{
25
    public function testConstructor()
26
    {
27
        $context = new Context(new ArrayCache());
28
        $loader = new ArticleLoader(__DIR__.'/Node/Resources/meta', new MetaFactory($context));
29
30
        $gimmeExtension = new GimmeExtension($context, $loader);
31
        self::assertEquals($gimmeExtension->getContext(), $context);
32
        self::assertEquals($gimmeExtension->getLoader(), $loader);
33
        self::assertEquals($gimmeExtension->getGlobals(), ['gimme' => $context]);
34
    }
35
}
36