Completed
Push — master ( 7b4297...eec074 )
by Aimeos
03:02
created

StandardTest   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 9 1
A tearDown() 0 4 1
A testCreate() 0 5 1
A testCopy() 0 5 1
A testDelete() 0 5 1
A testGet() 0 5 1
A testSave() 0 5 1
A testSearch() 0 6 1
A testGetSubClient() 0 5 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015
6
 */
7
8
9
namespace Aimeos\Admin\JQAdm\Dashboard\Order;
10
11
12
class StandardTest extends \PHPUnit_Framework_TestCase
13
{
14
	private $context;
15
	private $object;
16
	private $view;
17
18
19
	protected function setUp()
20
	{
21
		$this->view = \TestHelperJqadm::getView();
22
		$this->context = \TestHelperJqadm::getContext();
23
		$templatePaths = \TestHelperJqadm::getTemplatePaths();
24
25
		$this->object = new \Aimeos\Admin\JQAdm\Dashboard\Order\Standard( $this->context, $templatePaths );
26
		$this->object->setView( $this->view );
27
	}
28
29
30
	protected function tearDown()
31
	{
32
		unset( $this->object );
33
	}
34
35
36
	public function testCreate()
37
	{
38
		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
1 ignored issue
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::setExpectedException() has been deprecated with message: Method deprecated since Release 5.2.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
39
		$this->object->create();
40
	}
41
42
43
	public function testCopy()
44
	{
45
		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
1 ignored issue
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::setExpectedException() has been deprecated with message: Method deprecated since Release 5.2.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
46
		$this->object->copy();
47
	}
48
49
50
	public function testDelete()
51
	{
52
		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
1 ignored issue
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::setExpectedException() has been deprecated with message: Method deprecated since Release 5.2.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
53
		$this->object->delete();
54
	}
55
56
57
	public function testGet()
58
	{
59
		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
1 ignored issue
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::setExpectedException() has been deprecated with message: Method deprecated since Release 5.2.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
60
		$this->object->get();
61
	}
62
63
64
	public function testSave()
65
	{
66
		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
1 ignored issue
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::setExpectedException() has been deprecated with message: Method deprecated since Release 5.2.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
67
		$this->object->save();
68
	}
69
70
71
	public function testSearch()
72
	{
73
		$result = $this->object->search();
74
75
		$this->assertContains( '<div class="dashboard-order">', $result );
76
	}
77
78
79
	public function testGetSubClient()
80
	{
81
		$result = $this->object->getSubClient( 'paymentstatus' );
82
		$this->assertInstanceOf( '\Aimeos\Admin\JQAdm\Iface', $result );
83
	}
84
}
85