StandardTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 10
c 1
b 0
f 0
dl 0
loc 30
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 3 1
A testTransform() 0 4 1
A testTransformNoDefault() 0 4 1
A setUp() 0 5 1
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2025
6
 */
7
8
9
namespace Aimeos\Base\View\Helper\Param;
10
11
12
class StandardTest extends \PHPUnit\Framework\TestCase
13
{
14
	private $object;
15
16
17
	protected function setUp() : void
18
	{
19
		$view = new \Aimeos\Base\View\Standard();
20
		$param = array( 'page' => 'test' );
21
		$this->object = new \Aimeos\Base\View\Helper\Param\Standard( $view, $param );
22
	}
23
24
25
	protected function tearDown() : void
26
	{
27
		$this->object = null;
28
	}
29
30
31
	public function testTransform()
32
	{
33
		$this->assertEquals( 'test', $this->object->transform( 'page', 'none' ) );
34
		$this->assertEquals( 'none', $this->object->transform( 'missing', 'none' ) );
35
	}
36
37
38
	public function testTransformNoDefault()
39
	{
40
		$this->assertEquals( 'test', $this->object->transform( 'page' ) );
41
		$this->assertEquals( null, $this->object->transform( 'missing' ) );
42
	}
43
44
}
45