Passed
Push — master ( abee1f...edc958 )
by Kirill
03:08
created

SetTest::testPatch()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 17
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Config;
13
14
use Spiral\Config\Patch\Set;
15
16
class SetTest extends BaseTest
17
{
18
    public function testPatch(): void
19
    {
20
        $cf = $this->getFactory();
21
22
        $this->assertEquals(['value' => 'value!'], $cf->getConfig('scope'));
23
24
        $cf->modify('scope', new Set('value', 'x'));
25
26
        $this->assertSame([
27
            'value' => 'x',
28
        ], $cf->getConfig('scope'));
29
30
        $cf->modify('scope', new Set('value', 'y'));
31
32
        $this->assertSame([
33
            'value' => 'y',
34
        ], $cf->getConfig('scope'));
35
    }
36
}
37