BundleParametersTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 27
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A testBundleParameters() 0 5 1
A getSymfonyContainerAdapter() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Symplify\NetteAdapterForSymfonyBundles\Tests\Container;
6
7
use Nette\DI\Container;
8
use PHPUnit\Framework\TestCase;
9
use Symplify\NetteAdapterForSymfonyBundles\DI\NetteAdapterForSymfonyBundlesExtension;
10
use Symplify\NetteAdapterForSymfonyBundles\SymfonyContainerAdapter;
11
use Symplify\NetteAdapterForSymfonyBundles\Tests\ContainerFactory;
12
13
final class BundleParametersTest extends TestCase
14
{
15
    /**
16
     * @var Container
17
     */
18
    private $container;
19
20
    public function __construct()
21
    {
22
        $this->container = (new ContainerFactory())->createWithConfig(
23
            __DIR__ . '/SymfonyContainerAdapterSource/config/init.neon'
24
        );
25
    }
26
27
    public function testBundleParameters()
28
    {
29
        $symfonyContainerAdapter = $this->getSymfonyContainerAdapter();
30
        $this->assertTrue($symfonyContainerAdapter->hasParameter('doctrine.orm.proxy_namespace'));
31
    }
32
33
    private function getSymfonyContainerAdapter() : SymfonyContainerAdapter
34
    {
35
        return $this->container->getService(
36
            NetteAdapterForSymfonyBundlesExtension::SYMFONY_CONTAINER_SERVICE_NAME
37
        );
38
    }
39
}
40