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

ChainLoaderTest::testAddingNewLoader()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
/**
3
 * This file is part of the Superdesk Web Publisher Templates System.
4
 *
5
 * Copyright 2015 Sourcefabric z.ú. and contributors.
6
 *
7
 * For the full copyright and license information, please see the
8
 * AUTHORS and LICENSE files distributed with this source code.
9
 *
10
 * @copyright 2015 Sourcefabric z.ú
11
 * @license http://www.superdesk.org/license
12
 */
13
14
namespace SWP\Component\TemplatesSystem\Tests\Gimme\Loader;
15
16
use Doctrine\Common\Cache\ArrayCache;
17
use SWP\Component\TemplatesSystem\Gimme\Context\Context;
18
use SWP\Component\TemplatesSystem\Gimme\Factory\MetaFactory;
19
use SWP\Component\TemplatesSystem\Gimme\Loader\ArticleLoader;
20
use SWP\Component\TemplatesSystem\Gimme\Loader\ChainLoader;
21
22
class ChainLoaderTest extends \PHPUnit_Framework_TestCase
23
{
24
    private $loader;
25
26
    public function setUp()
27
    {
28
        $this->loader = new ChainLoader();
29
    }
30
31
    public function testAddingNewLoader()
32
    {
33
        $articleLoader = new ArticleLoader(
34
            __DIR__.'/../../Twig/Node',
35
            new MetaFactory(new Context(new ArrayCache()))
36
        );
37
        $this->loader->addLoader($articleLoader);
38
39
        $this->assertTrue($this->loader->isSupported('article'));
40
        unset($this->loader);
41
        unset($articleLoader);
42
    }
43
}
44