DefaultConfiguratorTest::test_default_construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Brendt\Image\Tests\Phpunit\Config;
4
5
use Brendt\Image\Config\DefaultConfigurator;
6
7
class DefaultConfiguratorTest extends \PHPUnit_Framework_TestCase
8
{
9
10
    public function test_default_construct() {
11
        new DefaultConfigurator();
12
    }
13
14
    public function test_construct_merges_config() {
15
        $configurator = new DefaultConfigurator([
16
            'enableCache' => true,
17
        ]);
18
19
        $this->assertTrue($configurator->getConfig()['enableCache']);
20
        $this->assertEquals('gd', $configurator->getConfig()['driver']);
21
    }
22
23
    /**
24
     * @expectedException \Brendt\Image\Exception\InvalidConfigurationException
25
     */
26
    public function test_construct_throws_exception_with_unknown_driver() {
27
        new DefaultConfigurator([
28
            'driver' => 'unknown',
29
        ]);
30
    }
31
32
}
33