EnvironmentFactoryTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreate() 0 15 1
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\Environment;
15
16
use Micro\Framework\Kernel\Configuration\DefaultApplicationConfiguration;
17
use Micro\Plugin\Twig\Business\Environment\EnvironmentFactory;
18
use Micro\Plugin\Twig\Business\Loader\LoaderProcessorInterface;
19
use Micro\Plugin\Twig\TwigPluginConfiguration;
20
use PHPUnit\Framework\TestCase;
21
use Twig\Environment;
22
23
class EnvironmentFactoryTest extends TestCase
24
{
25
    public function testCreate()
26
    {
27
        $appConfig = new DefaultApplicationConfiguration([]);
28
        $pluginConfig = new TwigPluginConfiguration($appConfig);
29
30
        $envLoader = $this->createMock(LoaderProcessorInterface::class);
31
32
        $envFactory = new EnvironmentFactory(
33
            $pluginConfig,
34
            $envLoader,
35
        );
36
37
        $twigEnv = $envFactory->create();
38
39
        $this->assertInstanceOf(Environment::class, $twigEnv);
40
    }
41
}
42