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\Framework\Kernel\Test\Unit\Boot; |
||||||
15 | |||||||
16 | use Micro\Component\DependencyInjection\Container; |
||||||
17 | use Micro\Framework\Kernel\Boot\DependedPluginsBootLoader; |
||||||
0 ignored issues
–
show
|
|||||||
18 | use Micro\Framework\Kernel\Kernel; |
||||||
19 | use Micro\Framework\Kernel\KernelInterface; |
||||||
20 | use Micro\Framework\Kernel\Plugin\PluginDependedInterface; |
||||||
21 | use Micro\Framework\Kernel\Test\Unit\PluginHasDepends; |
||||||
22 | use PHPUnit\Framework\TestCase; |
||||||
23 | |||||||
24 | class DependedPluginsBootLoaderTest extends TestCase |
||||||
25 | { |
||||||
26 | private KernelInterface|null $kernel = null; |
||||||
27 | |||||||
28 | private object $pluginNotHasDepends; |
||||||
0 ignored issues
–
show
|
|||||||
29 | |||||||
30 | private PluginDependedInterface $pluginDependedWithEmptyDepends; |
||||||
0 ignored issues
–
show
|
|||||||
31 | |||||||
32 | private PluginDependedInterface $pluginDependedWithDepends; |
||||||
0 ignored issues
–
show
|
|||||||
33 | |||||||
34 | protected function setUp(): void |
||||||
35 | { |
||||||
36 | } |
||||||
37 | |||||||
38 | public function testBoot() |
||||||
39 | { |
||||||
40 | $this->kernel = new Kernel( |
||||||
41 | [ |
||||||
42 | PluginHasDepends::class, |
||||||
43 | ], |
||||||
44 | [], |
||||||
45 | new Container(), |
||||||
46 | ); |
||||||
47 | |||||||
48 | $bootLoader = new DependedPluginsBootLoader($this->kernel); |
||||||
49 | $this->kernel->addBootLoader($bootLoader); |
||||||
0 ignored issues
–
show
The method
addBootLoader() does not exist on null .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
50 | $this->kernel->run(); |
||||||
51 | |||||||
52 | $i = 0; |
||||||
53 | foreach ($this->kernel->plugins() as $plugin) { |
||||||
54 | ++$i; |
||||||
55 | } |
||||||
56 | |||||||
57 | $this->assertEquals(3, $i); |
||||||
58 | } |
||||||
59 | } |
||||||
60 |
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