ConfigTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 18
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGet() 0 16 1
1
<?php
2
3
class ConfigTest extends \PHPUnit\Framework\TestCase
4
{
5
	public function testGet()
6
	{
7
		$settings = require dirname( dirname( __DIR__ ) ) . '/src/aimeos-default.php';
8
		$settings['frontend']['test'] = 1;
9
		$settings['backend']['test'] = 0;
10
11
		$container = new \Slim\Container();
12
		$container['aimeos'] = new \Aimeos\Bootstrap();
13
14
15
		$object = new \Aimeos\Slim\Base\Config( $container, $settings );
16
		$config = $object->get( 'frontend' );
17
18
		$this->assertInstanceOf( '\Aimeos\MW\Config\Iface', $config );
19
		$this->assertEquals( 1, $config->get( 'frontend/test', 0 ) );
20
		$this->assertEquals( 0, $config->get( 'backend/test', 1 ) );
21
	}
22
}
23