Completed
Branch unittests (a61d5f)
by Ruben
02:26
created

AbstractTestCase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 40
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEmptyConfig() 0 12 1
A getFullConfig() 0 14 1
1
<?php
2
3
namespace MovingImage\Bundle\VMProApiBundle\Tests\DependencyInjection;
4
5
use Symfony\Component\Yaml\Parser;
6
7
abstract class AbstractTestCase extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * Get empty configuration set.
11
     *
12
     * @return array
13
     */
14
    protected function getEmptyConfig()
15
    {
16
        $yaml = <<<'EOF'
17
vm_pro_api:
18
    credentials:
19
        username:  ~
20
        password:  ~
21
EOF;
22
        $parser = new Parser();
23
24
        return $parser->parse($yaml);
25
    }
26
27
    /**
28
     * Get empty configuration set.
29
     *
30
     * @return array
31
     */
32
    protected function getFullConfig()
33
    {
34
        $yaml = <<<'EOF'
35
vm_pro_api:
36
    base_url:      http://google.com/
37
    default_vm_id: 5
38
    credentials:
39
        username:  [email protected]
40
        password:  test_password
41
EOF;
42
        $parser = new Parser();
43
44
        return $parser->parse($yaml);
45
    }
46
}
47