Completed
Branch master (bae7d3)
by Dzmitry
05:41 queued 02:34
created

ConfigurationFactoryTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 1 Features 1
Metric Value
wmc 2
c 2
b 1
f 1
lcom 0
cbo 2
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreateFromArrayReturnsConfigurationByDefaultOnEmptyConfig() 0 7 1
A testCreateFromArrayReturnsConfigurationOnPassedArray() 0 7 1
1
<?php
2
3
use ivol\Config\ConfigurationFactory;
4
5
class ConfigurationFactoryTest extends PHPUnit_Framework_TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7
    public function testCreateFromArrayReturnsConfigurationByDefaultOnEmptyConfig()
8
    {
9
        $actual = ConfigurationFactory::createFromArray();
10
        
11
        $this->assertTrue($actual['escape_shell_args']);
12
        $this->assertTrue($actual['escape_shell_cmd']);
13
    }
14
15
    public function testCreateFromArrayReturnsConfigurationOnPassedArray()
16
    {
17
        $actual = ConfigurationFactory::createFromArray(['escape_shell_args' => false, 'escape_shell_cmd'=> false]);
18
19
        $this->assertFalse($actual['escape_shell_args']);
20
        $this->assertFalse($actual['escape_shell_cmd']);
21
    }
22
}
23