Passed
Push — master ( 6e9008...45eadc )
by Aimeos
31:58 queued 12:34
created

TestSite::getSiteId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
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), 2017-2023
6
 */
7
8
9
namespace Aimeos\Base\View\Helper\Site;
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
		$view->pageSiteItem = new \Aimeos\MShop\Locale\Item\Site\Standard( [
21
			'locale.site.siteid' => '1.',
22
			'locale.site.label' => 'label1'
23
		] );
24
25
		$this->object = new \Aimeos\Base\View\Helper\Site\Standard( $view );
26
	}
27
28
29
	protected function tearDown() : void
30
	{
31
		$this->object = null;
32
	}
33
34
35
	public function testTransform()
36
	{
37
		$this->assertInstanceOf( '\\Aimeos\\Base\\View\\Helper\\Site\\Iface', $this->object->transform() );
38
	}
39
40
41
	public function testCan()
42
	{
43
		$this->assertEquals( true, $this->object->transform()->can( '1.' ) );
44
		$this->assertEquals( true, $this->object->transform()->can( '1.2.' ) );
45
		$this->assertEquals( false, $this->object->transform()->can( '3.' ) );
46
	}
47
48
49
	public function testLabel()
50
	{
51
		$this->assertEquals( 'label1', $this->object->transform()->label() );
52
	}
53
54
55
	public function testMatch()
56
	{
57
		$this->assertEquals( 'label1', $this->object->transform()->match( '1.' ) );
58
	}
59
60
61
	public function testReadonly()
62
	{
63
		$this->assertEquals( 'readonly', $this->object->transform()->readonly( '1.2.' ) );
64
	}
65
66
67
	public function testSiteid()
68
	{
69
		$this->assertEquals( '1.', $this->object->transform()->siteid() );
70
	}
71
}
72