Completed
Push — master ( 0f478c...b73fd3 )
by Kamil
14:27 queued 08:29
created

SyliusChannelExtensionTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 45
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A it_fallbacks_to_enabled_kernel_debug_parameter_if_debug_is_not_defined() 0 8 1
A it_fallbacks_to_disabled_kernel_debug_parameter_if_debug_is_not_defined() 0 8 1
A it_uses_enabled_debug_config_if_defined() 0 6 1
A it_uses_disabled_debug_config_if_defined() 0 6 1
A getContainerExtensions() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
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
declare(strict_types=1);
13
14
namespace Sylius\Bundle\ChannelBundle\Tests\DependencyInjection;
15
16
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
17
use Sylius\Bundle\ChannelBundle\DependencyInjection\SyliusChannelExtension;
18
19
final class SyliusChannelExtensionTest extends AbstractExtensionTestCase
20
{
21
    /** @test */
22
    public function it_fallbacks_to_enabled_kernel_debug_parameter_if_debug_is_not_defined(): void
23
    {
24
        $this->container->setParameter('kernel.debug', true);
25
26
        $this->load([]);
27
28
        $this->assertContainerBuilderHasServiceDefinitionWithArgument('sylius.channel_collector', 2, true);
29
    }
30
31
    /** @test */
32
    public function it_fallbacks_to_disabled_kernel_debug_parameter_if_debug_is_not_defined(): void
33
    {
34
        $this->container->setParameter('kernel.debug', false);
35
36
        $this->load([]);
37
38
        $this->assertContainerBuilderHasServiceDefinitionWithArgument('sylius.channel_collector', 2, false);
39
    }
40
41
    /** @test */
42
    public function it_uses_enabled_debug_config_if_defined(): void
43
    {
44
        $this->load(['debug' => true]);
45
46
        $this->assertContainerBuilderHasServiceDefinitionWithArgument('sylius.channel_collector', 2, true);
47
    }
48
49
    /** @test */
50
    public function it_uses_disabled_debug_config_if_defined(): void
51
    {
52
        $this->load(['debug' => false]);
53
54
        $this->assertContainerBuilderHasServiceDefinitionWithArgument('sylius.channel_collector', 2, false);
55
    }
56
57
    protected function getContainerExtensions(): array
58
    {
59
        return [
60
            new SyliusChannelExtension(),
61
        ];
62
    }
63
}
64