HtmlTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2025
6
 */
7
8
9
namespace Aimeos\Client;
10
11
12
class HtmlTest extends \PHPUnit\Framework\TestCase
13
{
14
	private $context;
15
16
17
	protected function setUp() : void
18
	{
19
		$this->context = \TestHelper::context();
20
	}
21
22
23
	protected function tearDown() : void
24
	{
25
		unset( $this->context );
26
	}
27
28
29
	public function testCreate()
30
	{
31
		$client = \Aimeos\Client\Html::create( $this->context, 'account/favorite' );
32
		$this->assertInstanceOf( '\\Aimeos\\Client\\Html\\Iface', $client );
33
	}
34
35
36
	public function testCreateName()
37
	{
38
		$client = \Aimeos\Client\Html::create( $this->context, 'account/favorite', 'Standard' );
39
		$this->assertInstanceOf( '\\Aimeos\\Client\\Html\\Iface', $client );
40
	}
41
42
43
	public function testCreateNameEmpty()
44
	{
45
		$this->expectException( '\\Aimeos\\Client\\Html\\Exception' );
46
		\Aimeos\Client\Html::create( $this->context, '' );
47
	}
48
49
50
	public function testCreateNameParts()
51
	{
52
		$this->expectException( '\\Aimeos\\Client\\Html\\Exception' );
53
		\Aimeos\Client\Html::create( $this->context, 'account_unknown' );
54
	}
55
56
57
	public function testCreateNameInvalid()
58
	{
59
		$this->expectException( '\\Aimeos\\Client\\Html\\Exception' );
60
		\Aimeos\Client\Html::create( $this->context, '%^unknown' );
61
	}
62
63
64
	public function testCreateNameNotFound()
65
	{
66
		$this->expectException( '\\Aimeos\\Client\\Html\\Exception' );
67
		\Aimeos\Client\Html::create( $this->context, 'unknown' );
68
	}
69
70
}
71