ElasticaSpecificationBundleTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 4
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testBuildAddCompilerPass() 0 11 1
A testConstruction() 0 7 1
1
<?php
2
3
namespace Tests\GBProd\ElasticaSpecificationBundle;
4
5
use GBProd\ElasticaSpecificationBundle\DependencyInjection\Compiler\QueryFactoryPass;
6
use GBProd\ElasticaSpecificationBundle\ElasticaSpecificationBundle;
7
use PHPUnit\Framework\TestCase;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
use Symfony\Component\HttpKernel\Bundle\Bundle;
10
11
/**
12
 * Tests for ElasticaSpecificationBundle
13
 *
14
 * @author GBProd <[email protected]>
15
 */
16
class ElasticaSpecificationBundleTest extends TestCase
17
{
18
    public function testConstruction()
19
    {
20
        $bundle = new ElasticaSpecificationBundle();
21
22
        $this->assertInstanceOf(ElasticaSpecificationBundle::class, $bundle);
23
        $this->assertInstanceOf(Bundle::class, $bundle);
24
    }
25
26
    public function testBuildAddCompilerPass()
27
    {
28
        $container = $this->prophesize(ContainerBuilder::class);
29
        $container
30
            ->addCompilerPass(new QueryFactoryPass())
31
            ->shouldBeCalled()
32
        ;
33
34
        $bundle = new ElasticaSpecificationBundle();
35
        $bundle->build($container->reveal());
36
    }
37
}
38