|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 |
|
5
|
|
|
* @copyright Metaways Infosystems GmbH, 2011 |
|
6
|
|
|
* @copyright Aimeos (aimeos.org), 2014-2017 |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
|
|
10
|
|
|
namespace Aimeos\MW\View\Helper\Url; |
|
11
|
|
|
|
|
12
|
|
|
|
|
13
|
|
|
require_once __DIR__ . DIRECTORY_SEPARATOR . 'UriBuilder'; |
|
14
|
|
|
|
|
15
|
|
|
|
|
16
|
|
|
class T3CliTest extends \PHPUnit_Framework_TestCase |
|
17
|
|
|
{ |
|
18
|
|
|
private $view; |
|
19
|
|
|
|
|
20
|
|
|
|
|
21
|
|
|
protected function setUp() |
|
22
|
|
|
{ |
|
23
|
|
|
$this->view = new \Aimeos\MW\View\Standard(); |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
|
|
27
|
|
|
protected function tearDown() |
|
28
|
|
|
{ |
|
29
|
|
|
unset( $this->view ); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
|
|
33
|
|
|
public function testTransformAbsolute() |
|
34
|
|
|
{ |
|
35
|
|
|
$mock = $this->getMockBuilder( 'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder' ) |
|
36
|
|
|
->setMethods( array( 'setCreateAbsoluteUri') )->getMock(); |
|
37
|
|
|
|
|
38
|
|
|
$mock->expects( $this->once() )->method( 'setCreateAbsoluteUri' ) |
|
39
|
|
|
->with( $this->equalTo( true ) )->will( $this->returnValue( $mock ) ); |
|
40
|
|
|
|
|
41
|
|
|
$object = new \Aimeos\MW\View\Helper\Url\T3Cli( $this->view, $mock, array() ); |
|
42
|
|
|
|
|
43
|
|
|
$this->assertEquals( '', $object->transform() ); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
|
|
47
|
|
|
public function testTransformChash() |
|
48
|
|
|
{ |
|
49
|
|
|
$mock = $this->getMockBuilder( 'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder' ) |
|
50
|
|
|
->setMethods( array( 'setUseCacheHash') )->getMock(); |
|
51
|
|
|
|
|
52
|
|
|
$mock->expects( $this->once() )->method( 'setUseCacheHash' ) |
|
53
|
|
|
->with( $this->equalTo( false ) )->will( $this->returnValue( $mock ) ); |
|
54
|
|
|
|
|
55
|
|
|
$object = new \Aimeos\MW\View\Helper\Url\T3Cli( $this->view, $mock, array() ); |
|
56
|
|
|
|
|
57
|
|
|
$this->assertEquals( '', $object->transform() ); |
|
58
|
|
|
} |
|
59
|
|
|
} |
|
60
|
|
|
|