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

tests/DependencyInjection/ConfigurationTest.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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