|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace App\Tests\Functional; |
|
6
|
|
|
|
|
7
|
|
|
use Yiisoft\Config\Config; |
|
|
|
|
|
|
8
|
|
|
use PHPUnit\Framework\TestCase; |
|
|
|
|
|
|
9
|
|
|
use Yiisoft\Config\ConfigPaths; |
|
|
|
|
|
|
10
|
|
|
use Yiisoft\Config\Modifier\RecursiveMerge; |
|
|
|
|
|
|
11
|
|
|
use Yiisoft\Config\Modifier\ReverseMerge; |
|
|
|
|
|
|
12
|
|
|
use Yiisoft\Di\Container; |
|
|
|
|
|
|
13
|
|
|
use Yiisoft\Di\ContainerConfig; |
|
|
|
|
|
|
14
|
|
|
use Yiisoft\Yii\Event\ListenerConfigurationChecker; |
|
|
|
|
|
|
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
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths