InitTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A testGetService() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Symplify\NetteAdapterForSymfonyBundles\Tests\DoctrineBundle;
6
7
use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain;
8
use Doctrine\ORM\Configuration;
9
use Doctrine\ORM\Mapping\ClassMetadataFactory;
10
use Nette\DI\Container;
11
use PHPUnit\Framework\TestCase;
12
use Symplify\NetteAdapterForSymfonyBundles\Tests\ContainerFactory;
13
14
final class InitTest extends TestCase
15
{
16
    /**
17
     * @var Container
18
     */
19
    private $container;
20
21
    public function __construct()
22
    {
23
        $this->container = (new ContainerFactory())->createWithConfig(__DIR__ . '/config/init.neon');
24
    }
25
26
    public function testGetService()
27
    {
28
        /** @var Configuration $configuration */
29
        $configuration = $this->container->getByType(Configuration::class);
30
        $this->assertInstanceOf(Configuration::class, $configuration);
31
32
        $this->assertSame(ClassMetadataFactory::class, $configuration->getClassMetadataFactoryName());
33
        $this->assertInstanceOf(MappingDriverChain::class, $configuration->getMetadataDriverImpl());
34
    }
35
}
36