Completed
Push — master ( 9e3e67...1dbefb )
by Jeroen
08:30 queued 11s
created

ConfigurationTest::testDeprecatedAviaryConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Kunstmaan\MediaBundle\Tests\DependencyInjection;
4
5
use Kunstmaan\MediaBundle\DependencyInjection\Configuration;
6
use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait;
7
use PHPUnit\Framework\TestCase;
8
use Symfony\Component\HttpKernel\Kernel;
9
10
/**
11
 * Class ConfigurationTest
12
 */
13
class ConfigurationTest extends TestCase
14
{
15
    use ConfigurationTestCaseTrait;
16
17
    /**
18
     * @return \Symfony\Component\Config\Definition\ConfigurationInterface
19
     */
20
    protected function getConfiguration()
21
    {
22
        return new Configuration();
23
    }
24
25
    public function testConfigGeneratesAsExpected()
26
    {
27
        $array = [
28
            'soundcloud_api_key' => 'thisismykey',
29
            'remote_video' => [
30
                'vimeo' => false,
31
                'youtube' => true,
32
                'dailymotion' => false,
33
            ],
34
            'enable_pdf_preview' => true,
35
            'blacklisted_extensions' => [],
36
            'web_root' => '%kernel.project_dir%/web',
37
        ];
38
39
        if (Kernel::VERSION_ID >= 40000) {
40
            $array['web_root'] = '%kernel.project_dir%/public';
41
        }
42
43
        $expectedConfig = $array;
44
        $expectedConfig['aviary_api_key'] = null;
45
46
        $this->assertProcessedConfigurationEquals([$array], $expectedConfig);
47
    }
48
49
    /**
50
     * @group legacy
51
     * @expectedDeprecation The child node "aviary_api_key" at path "kunstmaan_media" is deprecated. Because the aviary service is discontinued.
52
     */
53
    public function testDeprecatedAviaryConfig()
54
    {
55
        $this->assertConfigurationIsValid([['aviary_api_key' => 'deprecated_key']]);
56
    }
57
}
58