Completed
Push — master ( 6c5077...d22a37 )
by Christian
01:33
created

ConfigurationTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testOptions() 0 17 1
A testCronOptions() 0 32 1
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
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
        $this->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
        $this->assertArraySubset($expected, $config);
0 ignored issues
show
Deprecated Code introduced by core23
The method PHPUnit\Framework\Assert::assertArraySubset() has been deprecated with message: https://github.com/sebastianbergmann/phpunit/issues/3494

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
67
    }
68
}
69