BdfSerializerBundleTest::testDefaultConfig()   A
last analyzed

Complexity

Conditions 4
Paths 3

Size

Total Lines 16
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
c 0
b 0
f 0
dl 0
loc 16
rs 9.9666
cc 4
nc 3
nop 0
1
<?php
2
3
namespace Bdf\SerializerBundle\Tests;
4
5
use Bdf\SerializerBundle\BdfSerializerBundle;
6
use Bdf\SerializerBundle\DependencyInjection\Compiler\SerializerLoaderPass;
7
use Bdf\SerializerBundle\DependencyInjection\Compiler\SerializerNormalizerPass;
8
use PHPUnit\Framework\TestCase;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
11
/**
12
 * BdfSerializerBundleTest.
13
 */
14
class BdfSerializerBundleTest extends TestCase
15
{
16
    public function testDefaultConfig()
17
    {
18
        $builder = new ContainerBuilder();
19
        $bundle = new BdfSerializerBundle();
20
        $bundle->build($builder);
21
22
        $compilerPasses = $builder->getCompiler()->getPassConfig()->getPasses();
23
        $found = 0;
24
25
        foreach ($compilerPasses as $pass) {
26
            if ($pass instanceof SerializerLoaderPass || $pass instanceof SerializerNormalizerPass) {
27
                ++$found;
28
            }
29
        }
30
31
        $this->assertSame(2, $found);
32
    }
33
}
34