Bukashk0zzzTimestampTypeExtensionTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php declare(strict_types = 1);
2
3
/*
4
 * This file is part of the Bukashk0zzzTimestampTypeBundle
5
 *
6
 * (c) Denis Golubovskiy <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Bukashk0zzz\TimestampTypeBundle\Tests\DependencyInjection;
13
14
use Bukashk0zzz\TimestampTypeBundle\DependencyInjection\Bukashk0zzzTimestampTypeExtension;
15
use PHPUnit\Framework\TestCase;
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
18
/**
19
 * Bukashk0zzzTimestampTypeExtensionTest
20
 */
21
class Bukashk0zzzTimestampTypeExtensionTest extends TestCase
22
{
23
    /**
24
     * @var Bukashk0zzzTimestampTypeExtension Bukashk0zzzTimestampTypeExtension
25
     */
26
    private $extension;
27
28
    /**
29
     * @var ContainerBuilder Container builder
30
     */
31
    private $container;
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    protected function setUp()
37
    {
38
        $this->extension = new Bukashk0zzzTimestampTypeExtension();
39
        $this->container = new ContainerBuilder();
40
        $this->container->registerExtension($this->extension);
41
    }
42
43
    /**
44
     * Test load extension
45
     */
46
    public function testLoadExtension(): void
47
    {
48
        $this->container->loadFromExtension($this->extension->getAlias());
49
        $this->container->compile();
50
51
        // Check that services have been loaded
52
        static::assertTrue($this->container->has('timestamp.type'));
53
    }
54
}
55