Passed
Push — test ( d838cf...cef4a5 )
by Tom
03:29
created

EnvParserTest::provideParseParameters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/* this file is part of pipelines */
4
5
namespace Ktomk\Pipelines\Utility;
6
7
use Ktomk\Pipelines\Cli\Args;
8
use Ktomk\Pipelines\Runner\Reference;
9
use Ktomk\Pipelines\TestCase;
10
11
/**
12
 * Class EnvParserTest
13
 *
14
 * @package Ktomk\Pipelines\Utility
15
 * @covers \Ktomk\Pipelines\Utility\EnvParser
16
 */
17
class EnvParserTest extends TestCase
18
{
19
    public function testCreation()
20
    {
21
        $args = new Args(array());
22
        $parser = EnvParser::create($args);
23
        self::assertInstanceOf('Ktomk\Pipelines\Utility\EnvParser', $parser);
24
    }
25
26
    public function provideParseParameters()
27
    {
28
        return array(
29
            array(array(), null, ''),
30
        );
31
    }
32
33
    /**
34
     * @dataProvider provideParseParameters
35
     *
36
     * @param array $inherit
37
     * @param null|string $reference
38
     * @param string $workingDir
39
     *
40
     * @throws \Ktomk\Pipelines\Cli\ArgsException
41
     */
42
    public function testParse(array $inherit, $reference, $workingDir)
43
    {
44
        $args = new Args(array());
45
46
        $reference = new Reference($reference);
47
        $env = EnvParser::create($args)->parse($inherit, $reference, $workingDir);
48
        self::assertInstanceOf('Ktomk\Pipelines\Runner\Env', $env);
49
    }
50
}
51