PluginLoaderTest::testLoadPlugins()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 11
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
4
namespace Deployee\Components\Plugins;
5
6
7
use Deployee\Components\Container\Container;
8
use Deployee\Components\Dependency\ContainerResolver;
0 ignored issues
show
Bug introduced by
The type Deployee\Components\Dependency\ContainerResolver 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 PHPUnit\Framework\TestCase;
10
use UnitTestPlugins\AwesomeTest\AwesomeTestPlugin;
11
use UnitTestPlugins\GreatTest\GreatTestPlugin;
12
use UnitTestPlugins\SuperTest\SuperTestPlugin;
13
14
class PluginLoaderTest extends TestCase
15
{
16
    public function testLoadPlugins()
17
    {
18
        $loader = new PluginLoader(new Container());
19
        $plugins = $loader->loadPlugins();
20
21
        $this->assertContains(GreatTestPlugin::class, array_keys($plugins));
22
        $this->assertInstanceOf(GreatTestPlugin::class, $plugins[GreatTestPlugin::class]);
23
        $this->assertContains(AwesomeTestPlugin::class, array_keys($plugins));
24
        $this->assertInstanceOf(AwesomeTestPlugin::class, $plugins[AwesomeTestPlugin::class]);
25
        $this->assertContains(SuperTestPlugin::class, array_keys($plugins));
26
        $this->assertInstanceOf(SuperTestPlugin::class, $plugins[SuperTestPlugin::class]);
27
    }
28
}