Passed
Push — master ( d86a4e...217e0a )
by Aimeos
02:12
created

ProtectTest::testApply()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Aimeos\Base\Config\Decorator;
4
5
6
class ProtectTest extends \PHPUnit\Framework\TestCase
7
{
8
	private $object;
9
10
11
	protected function setUp() : void
12
	{
13
		$conf = new \Aimeos\Base\Config\PHPArray( [] );
14
		$this->object = new \Aimeos\Base\Config\Decorator\Protect( $conf, array( 'client', 'admin' ) );
15
	}
16
17
18
	public function testGet()
19
	{
20
		$this->assertEquals( 'value', $this->object->get( 'client/html/test', 'value' ) );
21
	}
22
23
24
	public function testGetProtected()
25
	{
26
		$this->expectException( 'Aimeos\Base\Config\Exception' );
27
		$this->object->get( 'resource/db' );
28
	}
29
30
31
	public function testSet()
32
	{
33
		$this->assertInstanceOf( \Aimeos\Base\Config\Iface::class, $this->object->set( 'client/html/test', 'testval' ) );
34
	}
35
36
37
	public function testApply()
38
	{
39
		$this->assertInstanceOf( \Aimeos\Base\Config\Iface::class, $this->object->apply( ['resource' => ['db' => []]] ) );
40
	}
41
}
42