Completed
Push — master ( a2ed6a...66582b )
by André
23:40 queued 05:20
created

EzSystemsPlatformInstallerExtensionTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testLoadLoadsTaggedCoreInstaller() 0 13 1
A testLoadLoadsTaggedInstallerCommand() 0 9 1
A getContainerExtensions() 0 6 1
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace EzSystems\PlatformInstallerBundleTests\DependencyInjection;
10
11
use EzSystems\PlatformInstallerBundle\Command\InstallPlatformCommand;
12
use EzSystems\PlatformInstallerBundle\DependencyInjection\Compiler\InstallerTagPass;
13
use EzSystems\PlatformInstallerBundle\DependencyInjection\EzSystemsPlatformInstallerExtension;
14
use EzSystems\PlatformInstallerBundle\Installer\CoreInstaller;
15
use EzSystems\PlatformInstallerBundle\Installer\DbBasedInstaller;
16
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
17
18
/**
19
 * @covers \EzSystems\PlatformInstallerBundle\DependencyInjection\EzSystemsPlatformInstallerExtension
20
 */
21
class EzSystemsPlatformInstallerExtensionTest extends AbstractExtensionTestCase
22
{
23
    /**
24
     * @covers \EzSystems\PlatformInstallerBundle\DependencyInjection\EzSystemsPlatformInstallerExtension::load
25
     */
26
    public function testLoadLoadsTaggedCoreInstaller(): void
27
    {
28
        $this->load();
29
        $this->assertContainerBuilderHasServiceDefinitionWithParent(
30
            CoreInstaller::class,
31
            DbBasedInstaller::class
32
        );
33
        $this->assertContainerBuilderHasServiceDefinitionWithTag(
34
            CoreInstaller::class,
35
            InstallerTagPass::INSTALLER_TAG,
36
            ['type' => 'clean']
37
        );
38
    }
39
40
    /**
41
     * @covers \EzSystems\PlatformInstallerBundle\DependencyInjection\EzSystemsPlatformInstallerExtension::load
42
     */
43
    public function testLoadLoadsTaggedInstallerCommand(): void
44
    {
45
        $this->load();
46
        $this->assertContainerBuilderHasServiceDefinitionWithTag(
47
            InstallPlatformCommand::class,
48
            'console.command',
49
            ['command' => 'ezplatform:install']
50
        );
51
    }
52
53
    protected function getContainerExtensions(): array
54
    {
55
        return [
56
            new EzSystemsPlatformInstallerExtension(),
57
        ];
58
    }
59
}
60