ZenstruckScheduleBundleTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
dl 0
loc 21
rs 10
eloc 9

1 Method

Rating   Name   Duplication   Size   Complexity  
A compiler_pass_is_added() 0 16 3
1
<?php
2
3
namespace Zenstruck\ScheduleBundle\Tests;
4
5
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...
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Zenstruck\ScheduleBundle\DependencyInjection\Compiler\ScheduleBuilderKernelPass;
8
use Zenstruck\ScheduleBundle\ZenstruckScheduleBundle;
9
10
/**
11
 * @author Kevin Bond <[email protected]>
12
 */
13
final class ZenstruckScheduleBundleTest extends TestCase
14
{
15
    /**
16
     * @test
17
     */
18
    public function compiler_pass_is_added()
19
    {
20
        $container = new ContainerBuilder();
21
        $bundle = new ZenstruckScheduleBundle();
22
23
        $bundle->build($container);
24
25
        $foundPass = false;
26
27
        foreach ($container->getCompilerPassConfig()->getBeforeOptimizationPasses() as $pass) {
28
            if ($pass instanceof ScheduleBuilderKernelPass) {
29
                $foundPass = true;
30
            }
31
        }
32
33
        $this->assertTrue($foundPass, 'Compiler pass was not found');
34
    }
35
}
36