ConfigurationTest::testCronOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 32

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 32
rs 9.408
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * (c) Christian Gripp <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Core23\SitemapBundle\Tests\DependencyInjection;
11
12
use Core23\SitemapBundle\DependencyInjection\Configuration;
13
use PHPUnit\Framework\TestCase;
14
use Symfony\Component\Config\Definition\Processor;
15
16
final class ConfigurationTest extends TestCase
17
{
18
    public function testOptions(): void
19
    {
20
        $processor = new Processor();
21
22
        $config = $processor->processConfiguration(new Configuration(), [[
23
        ]]);
24
25
        $expected = [
26
            'static' => [
27
            ],
28
            'cache' => [
29
                'service' => null,
30
            ],
31
        ];
32
33
        static::assertSame($expected, $config);
34
    }
35
36
    public function testCronOptions(): void
37
    {
38
        $processor = new Processor();
39
40
        $config = $processor->processConfiguration(new Configuration(), [[
41
            'cache' => [
42
                'service' => 'acme.foo.service',
43
            ],
44
            'static' => [
45
                [
46
                    'url'        => 'http://example.com',
47
                    'priority'   => 100,
48
                    'changefreq' => 'daily',
49
                ],
50
            ],
51
        ]]);
52
53
        $expected = [
54
            'cache' => [
55
                'service' => 'acme.foo.service',
56
            ],
57
            'static' => [
58
                [
59
                    'url'        => 'http://example.com',
60
                    'priority'   => 100,
61
                    'changefreq' => 'daily',
62
                ],
63
            ],
64
        ];
65
66
        static::assertSame($expected, $config);
67
    }
68
}
69