Passed
Push — master ( cf7a49...93599e )
by Phillip
01:37
created

ShopConfigTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetFail() 0 5 1
A testGet() 0 7 1
1
<?php
2
3
4
namespace Deployee\Plugins\ShopwareTasks\Shop;
5
6
7
use PHPUnit\Framework\TestCase;
8
9
class ShopConfigTest extends TestCase
10
{
11
    public function testGet()
12
    {
13
        $shopConfig = new ShopConfig(__DIR__ . '/test_config.php');
14
15
        $this->assertSame('bar', $shopConfig->get('foo'));
16
        $this->assertSame(['foo1', 'foo2'], $shopConfig->get('bar'));
17
        $this->assertNull($shopConfig->get('foobar'));
18
    }
19
20
    public function testGetFail()
21
    {
22
        $shopConfig = new ShopConfig('/file/dies/not/exist.php');
23
        $this->expectException(\InvalidArgumentException::class);
24
        $shopConfig->get('foo');
25
    }
26
}