Completed
Push — master ( 702095...b9dfd2 )
by Aimeos
02:26
created

EzpublishTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 9 2
A tearDown() 0 4 1
A testGetEzUserService() 0 5 1
A testSetEzUserService() 0 7 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\MShop\Context\Item;
10
11
12
class EzpublishTest extends \PHPUnit_Framework_TestCase
13
{
14
	private $object;
15
16
17
	protected function setUp()
18
	{
19
		if( !interface_exists( 'eZ\Publish\API\Repository\UserService' ) ) {
20
			$this->markTestSkipped( 'Install ezsystems/ezpublish-api first' );
21
		}
22
23
		$this->mock = $this->getMockBuilder( 'eZ\Publish\API\Repository\UserService' )->getMock();
24
		$this->object = new \Aimeos\MShop\Context\Item\Ezpublish();
25
	}
26
27
28
	protected function tearDown()
29
	{
30
		unset( $this->object, $this->mock );
31
	}
32
33
34
	public function testGetEzUserService()
35
	{
36
		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
37
		$this->object->getEzUserService();
38
	}
39
40
41
	public function testSetEzUserService()
42
	{
43
		$return = $this->object->setEzUserService( $this->mock );
44
45
		$this->assertSame( $this->mock, $this->object->getEzUserService() );
46
		$this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $return );
47
	}
48
}
49