ConfigurationTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\MediaBundle\Tests\DependencyInjection;
15
16
use PHPUnit\Framework\TestCase;
17
use Sonata\MediaBundle\DependencyInjection\Configuration;
18
use Symfony\Component\Config\Definition\Processor;
19
20
class ConfigurationTest extends TestCase
21
{
22
    /**
23
     * @var array
24
     */
25
    protected $config;
26
27
    protected function setUp(): void
28
    {
29
        $configs = [
30
            'sonata_media' => [
31
                'db_driver' => 'doctrine_orm',
32
                'default_context' => 'default',
33
            ],
34
        ];
35
        $processor = new Processor();
36
        $configuration = new Configuration();
37
        $this->config = $processor->processConfiguration($configuration, $configs);
38
    }
39
40
    public function testProcess(): void
41
    {
42
        $this->assertArrayHasKey('resizers', $this->config);
43
        $this->assertArrayHasKey('default', $this->config['resizers']);
44
        $this->assertSame('sonata.media.resizer.simple', $this->config['resizers']['default']);
45
46
        $this->assertArrayHasKey('adapters', $this->config);
47
        $this->assertArrayHasKey('default', $this->config['adapters']);
48
        $this->assertSame('sonata.media.adapter.image.gd', $this->config['adapters']['default']);
49
    }
50
}
51