Completed
Push — master ( 76844d...a0c467 )
by Tomáš
02:57
created

DefaultAutowireTypesPassTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 19
rs 10
1
<?php
2
3
namespace Symplify\ControllerAutowire\Tests\DependencyInjection\Compiler;
4
5
use PHPUnit_Framework_TestCase;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Definition;
8
use Symplify\ControllerAutowire\DependencyInjection\Compiler\DefaultAutowireTypesPass;
9
10
final class DefaultAutowireTypesPassTest extends PHPUnit_Framework_TestCase
11
{
12
    public function testProcess()
13
    {
14
        $defaultAutowireTypesPass = new DefaultAutowireTypesPass();
15
16
        $containerBuilder = new ContainerBuilder();
17
        $containerBuilder->setParameter('kernel.root_dir', __DIR__);
18
19
        $definition = new Definition('Doctrine\ORM\EntityManagerInterface');
20
        $containerBuilder->setDefinition('doctrine.orm.default_entity_manager', $definition);
21
        $this->assertSame([], $definition->getAutowiringTypes());
22
23
        $defaultAutowireTypesPass->process($containerBuilder);
24
25
        $definition = $containerBuilder->getDefinition('doctrine.orm.default_entity_manager');
26
        $this->assertSame(['Doctrine\ORM\EntityManagerInterface'], $definition->getAutowiringTypes());
27
    }
28
}
29