Completed
Pull Request — master (#1163)
by Grégoire
02:51
created

ConfigurationTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

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