Completed
Push — master ( bd6d14...24ba7b )
by GBProd
02:04
created

testLoadHasServices()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Tests\GBProd\DoctrineSpecificationBundle\DependencyInjection;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use GBProd\DoctrineSpecificationBundle\DependencyInjection\DoctrineSpecificationExtension;
7
use GBProd\DoctrineSpecification\Handler;
8
use GBProd\DoctrineSpecification\Registry;
9
10
/**
11
 * Tests for DoctrineSpecificationExtension
12
 * 
13
 * @author gbprod <[email protected]>
14
 */
15
class DoctrineSpecificationExtensionTest extends \PHPUnit_Framework_TestCase
16
{
17
    private $extension;
18
    private $container;
19
20
    protected function setUp()
21
    {
22
        $this->extension = new DoctrineSpecificationExtension();
23
24
        $this->container = new ContainerBuilder();
25
        $this->container->registerExtension($this->extension);
26
        
27
        $this->container->loadFromExtension($this->extension->getAlias());
28
        $this->container->compile();
29
    }
30
    
31
    public function testLoadHasServices()
32
    {
33
        $this->assertTrue(
34
            $this->container->has('gbprod.doctrine_specification_registry')
35
        );
36
        
37
        $this->assertTrue(
38
            $this->container->has('gbprod.doctrine_specification_handler')
39
        );
40
    }
41
    
42
    public function testLoadRegistry()
43
    {
44
        $registry = $this->container->get('gbprod.doctrine_specification_registry');
45
        
46
        $this->assertInstanceOf(Registry::class, $registry);
47
    }
48
    
49
    public function testLoadHandler()
50
    {
51
        $handler = $this->container->get('gbprod.doctrine_specification_handler');
52
        
53
        $this->assertInstanceOf(Handler::class, $handler);
54
    }
55
}