StandardTest::tearDown()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2017-2025
6
 */
7
8
9
namespace Aimeos\Base\View\Helper\Session;
10
11
12
class StandardTest extends \PHPUnit\Framework\TestCase
13
{
14
	private $object;
15
	private $session;
16
17
18
	protected function setUp() : void
19
	{
20
		$view = new \Aimeos\Base\View\Standard();
21
		$this->session = new \Aimeos\Base\Session\None();
22
23
		$this->object = new \Aimeos\Base\View\Helper\Session\Standard( $view, $this->session );
24
	}
25
26
27
	protected function tearDown() : void
28
	{
29
		unset( $this->object, $this->session );
30
	}
31
32
33
	public function testTransform()
34
	{
35
		$this->session->set( 'page', 'test' );
36
37
		$this->assertEquals( 'test', $this->object->transform( 'page', 'none' ) );
38
		$this->assertEquals( 'none', $this->object->transform( 'missing', 'none' ) );
39
	}
40
41
42
	public function testTransformNoDefault()
43
	{
44
		$this->session->set( 'page', 'test' );
45
46
		$this->assertEquals( 'test', $this->object->transform( 'page' ) );
47
		$this->assertEquals( null, $this->object->transform( 'missing' ) );
48
	}
49
}
50