Completed
Push — 2017.02 ( 019753 )
by Aimeos
02:05
created

T3CliTest::testTransformChash()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
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