Passed
Push — master ( 4b5f24...20219f )
by Brent
02:15
created

DefaultConfiguratorTest::test_default_construct()   A

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\tests\phpunit\config;
4
5
use brendt\image\config\DefaultConfigurator;
6
7
class DefaultConfiguratorTest extends \PHPUnit_Framework_TestCase {
8
9
    public function test_default_construct() {
10
        new DefaultConfigurator();
11
    }
12
13
    public function test_construct_merges_config() {
14
        $configurator = new DefaultConfigurator([
15
            'enableCache' => true
16
        ]);
17
18
        $this->assertTrue($configurator->getConfig()['enableCache']);
19
        $this->assertEquals('gd', $configurator->getConfig()['driver']);
20
    }
21
22
    /**
23
     * @expectedException brendt\image\exception\InvalidConfigurationException
24
     */
25
    public function test_construct_throws_exception_with_unknown_driver() {
26
        new DefaultConfigurator([
27
            'driver' => 'unknown'
28
        ]);
29
    }
30
31
}
32