LoaderProcessorTest::testLoad()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 16
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 24
rs 9.7333
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 *  This file is part of the Micro framework package.
7
 *
8
 *  (c) Stanislau Komar <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace Micro\Plugin\Twig\Test\Unit\Business\Loader;
15
16
use Micro\Framework\Kernel\KernelInterface;
17
use Micro\Plugin\Twig\Business\Loader\LoaderInterface;
18
use Micro\Plugin\Twig\Business\Loader\LoaderProcessor;
19
use Micro\Plugin\Twig\Plugin\TwigTemplatePluginInterface;
20
use PHPUnit\Framework\TestCase;
21
use Twig\Environment;
22
use Twig\Extension\ExtensionInterface;
23
24
class LoaderProcessorTest extends TestCase
25
{
26
    public function testLoad()
27
    {
28
        $kernel = $this->createMock(KernelInterface::class);
29
        $kernel
30
            ->expects($this->once())
31
            ->method('plugins')
32
            ->willReturn(new \ArrayObject([
33
                new \stdClass(),
34
                $this->createMock(ExtensionInterface::class),
35
                $this->createMock(TwigTemplatePluginInterface::class),
36
            ]));
37
38
        $loader1 = $this->createMock(LoaderInterface::class);
39
        $loader2 = $this->createMock(LoaderInterface::class);
40
41
        $loaderProcessor = new LoaderProcessor(
42
            $kernel,
43
            new \ArrayObject([
44
                $loader1, $loader2,
45
            ]),
46
        );
47
48
        $twigEnv = $this->createMock(Environment::class);
49
        $loaderProcessor->load($twigEnv);
50
    }
51
}
52