ConsolePluginTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testPlugin() 0 10 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\Console\Test\Unit;
15
16
use Micro\Component\DependencyInjection\Autowire\ContainerAutowire;
17
use Micro\Component\DependencyInjection\Container;
18
use Micro\Framework\Kernel\Plugin\DependencyProviderInterface;
19
use Micro\Plugin\Console\ConsolePlugin;
20
use Micro\Plugin\Console\Facade\ConsoleApplicationFacadeInterface;
21
use Micro\Plugin\Locator\Facade\LocatorFacadeInterface;
22
use PHPUnit\Framework\TestCase;
23
24
class ConsolePluginTest extends TestCase
25
{
26
    public function testPlugin()
27
    {
28
        $plugin = new ConsolePlugin();
29
        $this->assertInstanceOf(DependencyProviderInterface::class, $plugin);
30
        $container = new ContainerAutowire(new Container());
31
        $container->register(LocatorFacadeInterface::class, fn () => $this->createMock(LocatorFacadeInterface::class));
32
        $container->register(Container::class, fn () => $container);
33
34
        $plugin->provideDependencies($container);
35
        $this->assertInstanceOf(ConsoleApplicationFacadeInterface::class, $container->get(ConsoleApplicationFacadeInterface::class));
36
    }
37
}
38