FileLocatorTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
c 0
b 0
f 0
dl 0
loc 20
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testLookup() 0 18 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\DTO\Test\Unit\Business\FileLocator;
15
16
use Micro\Framework\Kernel\Configuration\DefaultApplicationConfiguration;
17
use Micro\Kernel\App\AppKernelInterface;
18
use Micro\Plugin\DTO\Business\FileLocator\FileLocator;
19
use Micro\Plugin\DTO\DTOPluginConfiguration;
20
use Micro\Plugin\DTO\Test\Unit\TestPlugin;
21
use PHPUnit\Framework\TestCase;
22
23
class FileLocatorTest extends TestCase
24
{
25
    public function testLookup()
26
    {
27
        $appKernel = $this->createMock(AppKernelInterface::class);
28
        $appKernel->method('plugins')->willReturn(new \ArrayObject([
29
            new TestPlugin(),
30
        ]));
31
32
        $appCfg = new DefaultApplicationConfiguration([
33
            'DTO_CLASS_SOURCE_PATH' => __DIR__,
34
        ]);
35
        $cfg = new DTOPluginConfiguration($appCfg);
36
37
        $fileLocator = new FileLocator(
38
            $cfg,
39
            $appKernel,
40
        );
41
42
        $this->assertIsArray($fileLocator->lookup());
43
    }
44
}
45