Passed
Push — master ( 928310...983cfc )
by Aimeos
04:45
created

StandardTest::testGetSubClientInvalidName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2020
6
 */
7
8
9
namespace Aimeos\Client\Html\Account\Review\Todo;
10
11
12
class StandardTest extends \PHPUnit\Framework\TestCase
13
{
14
	private $object;
15
	private $context;
16
17
18
	protected function setUp() : void
19
	{
20
		$this->context = \TestHelperHtml::getContext();
21
22
		$customer = \Aimeos\MShop\Customer\Manager\Factory::create( $this->context )->find( '[email protected]' );
23
		$this->context->setUserId( $customer->getId() );
24
25
		$this->object = new \Aimeos\Client\Html\Account\Review\Todo\Standard( $this->context );
26
		$this->object->setView( \TestHelperHtml::getView() );
27
	}
28
29
30
	protected function tearDown() : void
31
	{
32
		unset( $this->object, $this->context );
33
	}
34
35
36
	public function testGetBody()
37
	{
38
		$view = \TestHelperHtml::getView();
39
		$this->object->setView( $this->object->addData( $view ) );
40
41
		$output = $this->object->getBody();
42
43
		$this->assertStringContainsString( '<section class="account-review-todo">', $output );
44
	}
45
46
47
	public function testGetSubClientInvalid()
48
	{
49
		$this->expectException( '\\Aimeos\\Client\\Html\\Exception' );
50
		$this->object->getSubClient( 'invalid', 'invalid' );
51
	}
52
53
54
	public function testGetSubClientInvalidName()
55
	{
56
		$this->expectException( '\\Aimeos\\Client\\Html\\Exception' );
57
		$this->object->getSubClient( '$$$', '$$$' );
58
	}
59
}
60