Passed
Push — master ( 807219...75274e )
by Aimeos
04:19
created

StandardTest::testHeaderException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 13
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Metaways Infosystems GmbH, 2014
6
 * @copyright Aimeos (aimeos.org), 2015-2022
7
 */
8
9
10
namespace Aimeos\Client\Html\Catalog\Count;
11
12
13
class StandardTest extends \PHPUnit\Framework\TestCase
14
{
15
	private $context;
16
	private $object;
17
18
19
	protected function setUp() : void
20
	{
21
		$this->context = \TestHelperHtml::context();
22
23
		$this->object = new \Aimeos\Client\Html\Catalog\Count\Standard( $this->context );
24
		$this->object->setView( \TestHelperHtml::view() );
25
	}
26
27
28
	protected function tearDown() : void
29
	{
30
		unset( $this->object );
31
	}
32
33
34
	public function testBody()
35
	{
36
		$output = $this->object->body();
37
38
		$this->assertStringContainsString( 'var attributeCount', $output );
39
		$this->assertStringContainsString( 'var catalogCounts', $output );
40
		$this->assertStringContainsString( 'var supplierCount', $output );
41
	}
42
43
44
	public function testHeader()
45
	{
46
		$this->object->setView( $this->object->data( \TestHelperHtml::view() ) );
47
48
		$output = $this->object->header();
49
50
		$this->assertNotNull( $output );
51
	}
52
53
54
	public function testGetSubClient()
55
	{
56
		$client = $this->object->getSubClient( 'tree', 'Standard' );
57
		$this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
58
	}
59
60
61
	public function testGetSubClientInvalid()
62
	{
63
		$this->expectException( '\\Aimeos\\Client\\Html\\Exception' );
64
		$this->object->getSubClient( 'invalid', 'invalid' );
65
	}
66
67
68
	public function testGetSubClientInvalidName()
69
	{
70
		$this->expectException( '\\Aimeos\\Client\\Html\\Exception' );
71
		$this->object->getSubClient( '$$$', '$$$' );
72
	}
73
74
}
75