Bukashk0zzzFilterExtensionTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 11
c 2
b 1
f 0
dl 0
loc 36
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testLoadExtension() 0 8 1
A setUp() 0 8 1
1
<?php declare(strict_types = 1);
2
3
namespace Bukashk0zzz\FilterBundle\Tests\DependencyInjection;
4
5
use Bukashk0zzz\FilterBundle\DependencyInjection\Bukashk0zzzFilterExtension;
6
use PHPUnit\Framework\TestCase;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
9
/**
10
 * Bukashk0zzzFilterExtensionTest.
11
 *
12
 * @internal
13
 */
14
final class Bukashk0zzzFilterExtensionTest extends TestCase
15
{
16
    /**
17
     * @var Bukashk0zzzFilterExtension Bukashk0zzzFilterExtension
18
     */
19
    private $extension;
20
21
    /**
22
     * @var ContainerBuilder Container builder
23
     */
24
    private $container;
25
26
    /**
27
     * Setup.
28
     */
29
    protected function setUp(): void
30
    {
31
        $this->extension = new Bukashk0zzzFilterExtension();
32
        $this->container = new ContainerBuilder();
33
34
        $this->container->set('annotations.cached_reader', new \stdClass());
35
36
        $this->container->registerExtension($this->extension);
37
    }
38
39
    /**
40
     * Test load extension.
41
     */
42
    public function testLoadExtension(): void
43
    {
44
        $this->container->prependExtensionConfig($this->extension->getAlias(), ['auto_filter_forms' => true]);
45
        $this->container->loadFromExtension($this->extension->getAlias());
46
        $this->container->compile();
47
48
        // Check that services have been loaded
49
        static::assertTrue($this->container->has('bukashk0zzz_filter.filter'));
50
    }
51
}
52