Passed
Pull Request — master (#253)
by Wilmer
01:59
created

testConsoleListenerConfiguration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 11
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Tests\Functional;
6
7
use PHPUnit\Framework\TestCase;
8
use Psr\Container\ContainerInterface;
9
use Yiisoft\Config\ConfigPaths;
10
use Yiisoft\Di\Container;
11
use Yiisoft\Di\ContainerConfig;
12
use Yiisoft\Yii\Event\ListenerConfigurationChecker;
13
use Yiisoft\Yii\Runner\ConfigFactory;
14
15
use function dirname;
16
17
class EventListenerConfigurationTest extends TestCase
18
{
19
    public function testConsoleListenerConfiguration(): void
20
    {
21
        $config = ConfigFactory::create(new ConfigPaths(dirname(__DIR__, 2), 'config'), null);
22
23
        $containerConfig = ContainerConfig::create()
24
            ->withDefinitions($config->get('console'));
25
        $container = (new Container($containerConfig))->get(ContainerInterface::class);
26
        $checker = $container->get(ListenerConfigurationChecker::class);
27
        $checker->check($config->get('events-console'));
28
29
        self::assertInstanceOf(ListenerConfigurationChecker::class, $checker);
30
    }
31
}
32