Passed
Push — master ( ffa4cd...db3132 )
by Aimeos
02:35
created

EzpublishTest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 46
rs 10
wmc 7

6 Methods

Rating   Name   Duplication   Size   Complexity  
A testDeleteItems() 0 3 1
A testGetSubManager() 0 4 1
A testGetSearchAttributes() 0 7 2
A tearDown() 0 3 1
A setUp() 0 5 1
A testClear() 0 3 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2016-2018
6
 */
7
8
9
namespace Aimeos\MShop\Customer\Manager\Address;
10
11
12
class EzpublishTest extends \PHPUnit\Framework\TestCase
13
{
14
	private $object;
15
16
17
	protected function setUp() : void
18
	{
19
		$customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( \TestHelper::getContext() );
20
21
		$this->object = $customer->getSubManager( 'address', 'Ezpublish' );
22
	}
23
24
25
	protected function tearDown() : void
26
	{
27
		unset( $this->object );
28
	}
29
30
31
	public function testClear()
32
	{
33
		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->clear( array( -1 ) ) );
34
	}
35
36
37
	public function testDeleteItems()
38
	{
39
		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->deleteItems( array( -1 ) ) );
40
	}
41
42
43
	public function testGetSearchAttributes()
44
	{
45
		$attributes = $this->object->getSearchAttributes();
46
		$this->assertGreaterThan( 0, count( $attributes ) );
47
48
		foreach( $attributes as $attribute ) {
49
			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
50
		}
51
	}
52
53
54
	public function testGetSubManager()
55
	{
56
		$this->expectException( '\\Aimeos\\MShop\\Exception' );
57
		$this->object->getSubManager( 'unknown' );
58
	}
59
}
60