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

ShopConfigTest::testGetFail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
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
}