Completed
Push — master ( cda577...82aa13 )
by Christian
02:25
created

SetCommandTest::testExecute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 9.552
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace N98\Magento\Command\Config\Env;
4
5
use N98\Magento\Command\TestCase;
6
7
/**
8
 * Class ShowCommandTest
9
 * @package N98\Magento\Command\Config\Env
10
 */
11
class SetCommandTest extends TestCase
12
{
13
    /**
14
     * @dataProvider dataProvider
15
     */
16
    public function testExecute($value)
17
    {
18
        // Check if config gets set
19
        $this->assertDisplayContains(
20
            [
21
                'command' => 'config:env:set',
22
                'key' => 'magerun.test',
23
                'value' => $value
24
            ],
25
            'Config magerun.test successfully set to ' . $value
26
        );
27
28
        // Check for idempotency
29
        $this->assertDisplayContains(
30
            [
31
                'command' => 'config:env:set',
32
                'key' => 'magerun.test',
33
                'value' => $value,
34
                '--verbose' => true // Add dummy option to force different input hash
35
            ],
36
            'Config was already set'
37
        );
38
    }
39
40
    public function dataProvider(): array
41
    {
42
        return [
43
            ['0'],
44
            ['1'],
45
            ['A'],
46
            ['B'],
47
            ['0A1B'],
48
        ];
49
    }
50
}
51