Completed
Branch master (4ffab1)
by Aimeos
02:31
created

BaseTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 5
c 1
b 1
f 0
lcom 1
cbo 3
dl 0
loc 38
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 7 1
A testCall() 0 4 1
A testCallInvalid() 0 5 1
A testGetContext() 0 4 1
A testGetController() 0 4 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2016
6
 */
7
8
9
namespace Aimeos\Controller\Frontend\Common\Decorator;
10
11
12
class BaseTest extends \PHPUnit_Framework_TestCase
13
{
14
	private $object;
15
16
17
	protected function setUp()
18
	{
19
		$context = \TestHelperFrontend::getContext();
20
		$cntl = new \Aimeos\Controller\Frontend\Catalog\Standard( $context );
21
22
		$this->object = new \Aimeos\Controller\Frontend\Common\Decorator\Example( $cntl, $context );
23
	}
24
25
26
	public function testCall()
27
	{
28
		$this->assertInstanceOf( '\Aimeos\MShop\Common\Manager\Iface', $this->object->createManager( 'product' ) );
29
	}
30
31
32
	public function testCallInvalid()
33
	{
34
		$this->setExpectedException( '\Aimeos\Controller\Frontend\Exception' );
35
		$this->object->invalidMethod();
36
	}
37
38
39
	public function testGetContext()
40
	{
41
		$this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $this->object->getContext() );
42
	}
43
44
45
	public function testGetController()
46
	{
47
		$this->assertInstanceOf( '\Aimeos\Controller\Frontend\Iface', $this->object->getController() );
48
	}
49
}