|
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
|
|
|
|