testConsoleListenerConfiguration()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 14
nc 1
nop 0
dl 0
loc 24
rs 9.7998
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Tests\Functional;
6
7
use Yiisoft\Config\Config;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Config\Config was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use PHPUnit\Framework\TestCase;
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Yiisoft\Config\ConfigPaths;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Config\ConfigPaths was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use Yiisoft\Config\Modifier\RecursiveMerge;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Config\Modifier\RecursiveMerge was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Yiisoft\Config\Modifier\ReverseMerge;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Config\Modifier\ReverseMerge was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Yiisoft\Di\Container;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Di\Container was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use Yiisoft\Di\ContainerConfig;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Di\ContainerConfig was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use Yiisoft\Yii\Event\ListenerConfigurationChecker;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Yii\Event\ListenerConfigurationChecker was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
16
class EventListenerConfigurationTest extends TestCase
17
{
18
    public function testConsoleListenerConfiguration(): void
19
    {
20
        $config = new Config(
21
            new ConfigPaths(dirname(__DIR__, 2), 'config'),
22
            $_ENV['YII_ENV'],
23
            [
24
                ReverseMerge::groups('events', 'events-web', 'events-console'),
25
                RecursiveMerge::groups('params', 'params-web', 'params-console', 'events', 'events-web', 'events-console'),
26
            ],
27
            'params-console',
28
        );
29
30
        $container = new Container(
31
            ContainerConfig::create()
32
                ->withDefinitions($config->get('di-console'))
33
                ->withProviders($config->get('di-providers-console'))
34
        );
35
36
        $checker = $container->get(ListenerConfigurationChecker::class);
37
38
        $checker->check($config->get('events-console'));
39
        $checker->check($config->get('events-web'));
40
41
        self::assertInstanceOf(ListenerConfigurationChecker::class, $checker);
42
    }
43
}
44