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

EzpublishTest::testSaveUpdateDeleteItem()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 75
Code Lines 65

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 75
rs 9
cc 1
eloc 65
nc 1
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

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\Customer\Manager\Address;
10
11
12
class EzpublishTest extends \PHPUnit_Framework_TestCase
13
{
14
	private $object;
15
16
17
	protected function setUp()
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()
26
	{
27
		unset( $this->object );
28
	}
29
30
31
	public function testCleanup()
32
	{
33
		$this->object->cleanup( array( -1 ) );
34
	}
35
36
37
	public function testDeleteItems()
38
	{
39
		$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->setExpectedException( '\\Aimeos\\MShop\\Exception' );
57
		$this->object->getSubManager( 'unknown' );
58
	}
59
}
60