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
|
|
|
|