DefaultConfiguratorTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 26
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A test_default_construct() 0 3 1
A test_construct_merges_config() 0 8 1
A test_construct_throws_exception_with_unknown_driver() 0 5 1
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