StandardTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 43
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 6 1
A testBody() 0 7 1
A testGetSubClient() 0 4 1
A setUp() 0 10 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2020-2025
6
 */
7
8
9
namespace Aimeos\Client\Html\Catalog\Price;
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
		\Aimeos\Controller\Frontend::cache( true );
22
		\Aimeos\MShop::cache( true );
23
24
		$this->view = \TestHelper::view();
25
		$this->context = \TestHelper::context();
26
27
		$this->object = new \Aimeos\Client\Html\Catalog\Price\Standard( $this->context );
28
		$this->object->setView( $this->view );
29
	}
30
31
32
	protected function tearDown() : void
33
	{
34
		\Aimeos\Controller\Frontend::cache( false );
35
		\Aimeos\MShop::cache( false );
36
37
		unset( $this->object, $this->context, $this->view );
38
	}
39
40
41
	public function testBody()
42
	{
43
		$this->object->setView( $this->object->data( $this->view ) );
44
		$output = $this->object->body();
45
46
		$this->assertStringContainsString( '<div class="section aimeos catalog-filter"', $output );
47
		$this->assertStringContainsString( '<div class="section catalog-filter-price', $output );
48
	}
49
50
51
	public function testGetSubClient()
52
	{
53
		$client = $this->object->getSubClient( 'price', 'Standard' );
54
		$this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
55
	}
56
}
57