Bukashk0zzzBooleanTypeExtensionTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A testLoadExtension() 0 8 1
1
<?php declare(strict_types = 1);
2
3
namespace Bukashk0zzz\BooleanTypeBundle\Tests\DependencyInjection;
4
5
use Bukashk0zzz\BooleanTypeBundle\DependencyInjection\Bukashk0zzzBooleanTypeExtension;
6
use PHPUnit\Framework\TestCase;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
9
/**
10
 * @internal
11
 */
12
final class Bukashk0zzzBooleanTypeExtensionTest extends TestCase
13
{
14
    /**
15
     * @var Bukashk0zzzBooleanTypeExtension Bukashk0zzzBooleanTypeExtension
16
     */
17
    private $extension;
18
19
    /**
20
     * @var ContainerBuilder Container builder
21
     */
22
    private $container;
23
24
    protected function setUp(): void
25
    {
26
        $this->extension = new Bukashk0zzzBooleanTypeExtension();
27
        $this->container = new ContainerBuilder();
28
        $this->container->registerExtension($this->extension);
29
    }
30
31
    /**
32
     * Test load extension.
33
     */
34
    public function testLoadExtension(): void
35
    {
36
        $this->container->loadFromExtension($this->extension->getAlias());
37
        $this->container->compile();
38
39
        // Check that services have been loaded
40
        self::assertTrue($this->container->has('boolean.type'));
41
    }
42
}
43