HtmlTest   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 56
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreateName() 0 4 1
A testCreateNameNotFound() 0 4 1
A testCreateNameInvalid() 0 4 1
A setUp() 0 3 1
A testCreate() 0 4 1
A testCreateNameEmpty() 0 4 1
A tearDown() 0 3 1
A testCreateNameParts() 0 4 1
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