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

BaseTest::testGetContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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