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

GroupTest::testPatch()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 15
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\Append;
15
use Spiral\Config\Patch\Delete;
16
use Spiral\Config\Patch\Group;
17
use Spiral\Config\Patch\Prepend;
18
19
class GroupTest extends BaseTest
20
{
21
    public function testPatch(): void
22
    {
23
        $cf = $this->getFactory();
24
        $this->assertEquals(['value' => 'value!'], $cf->getConfig('scope'));
25
26
        $cf->modify('scope', new Group(
27
            new Prepend('.', 'other', ['a' => 'b']),
28
            new Delete('other', 'a'),
29
            new Append('other', 'c', 'd')
30
        ));
31
32
        $this->assertEquals([
33
            'other' => ['c' => 'd'],
34
            'value' => 'value!'
35
        ], $cf->getConfig('scope'));
36
    }
37
}
38