ConfigDefaultTest::testFactory()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 13
Ratio 100 %

Importance

Changes 0
Metric Value
dl 13
loc 13
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the php-utilities package.
4
 *
5
 * (c) Marc Aschmann <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Asm\Tests\Config;
11
12
use Asm\Config\Config;
13
use Asm\Config\ConfigDefault;
14
use Asm\Test\BaseConfigTest;
15
16
/**
17
 * Class ConfigDefaultTest
18
 *
19
 * @package Asm\Tests\Config
20
 * @author marc aschmann <[email protected]>
21
 */
22
class ConfigDefaultTest extends BaseConfigTest
23
{
24
    /**
25
     * @covers \Asm\Config\AbstractConfig::readConfig
26
     * @covers \Asm\Config\AbstractConfig::setConfig
27
     */
28 View Code Duplication
    public function testFactory()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
29
    {
30
        $config = Config::factory(
31
            [
32
                'file' => $this->getTestYaml(),
33
            ],
34
            'ConfigDefault'
35
        );
36
37
        $this->assertInstanceOf('Asm\Config\ConfigDefault', $config);
38
39
        return $config;
40
    }
41
42
    /**
43
     * @depends testFactory
44
     * @param ConfigDefault $config
45
     */
46
    public function testImport(ConfigDefault $config)
47
    {
48
        $this->assertEquals(
49
            [
50
                'default' => 'yaddayadda',
51
                'my_test' => 'is testing hard'
52
            ],
53
            $config->get('testkey_5')
54
        );
55
    }
56
}
57