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

EnvParserTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testParse() 0 7 1
A provideParseParameters() 0 4 1
A testCreation() 0 5 1
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