Passed
Push — master ( 8bf70e...6a7093 )
by Aimeos
03:42
created

StandardTest::testBodyFrontendException()   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 Aimeos (aimeos.org), 2015-2022
6
 */
7
8
9
namespace Aimeos\Client\Html\Catalog\Session;
10
11
12
class StandardTest extends \PHPUnit\Framework\TestCase
13
{
14
	private $object;
15
	private $context;
16
	private $view;
17
18
19
	protected function setUp() : void
20
	{
21
		$this->view = \TestHelperHtml::view();
22
		$this->context = \TestHelperHtml::context();
23
24
		$this->object = new \Aimeos\Client\Html\Catalog\Session\Standard( $this->context );
25
		$this->object->setView( $this->view );
26
	}
27
28
29
	protected function tearDown() : void
30
	{
31
		unset( $this->object, $this->context, $this->view );
32
	}
33
34
35
	public function testHeader()
36
	{
37
		$output = $this->object->header();
38
39
		$this->assertStringContainsString( '<link rel="stylesheet"', $output );
40
		$this->assertStringContainsString( '<script defer', $output );
41
	}
42
43
44
	public function testBody()
45
	{
46
		$this->object->setView( $this->object->data( $this->view ) );
47
		$output = $this->object->body();
48
49
		$this->assertStringStartsWith( '<section class="aimeos catalog-session"', $output );
50
	}
51
52
53
	public function testGetSubClient()
54
	{
55
		$client = $this->object->getSubClient( 'seen', 'Standard' );
56
		$this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
57
	}
58
}
59