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

T3CliTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 44
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A tearDown() 0 4 1
A testTransformAbsolute() 0 12 1
A testTransformChash() 0 12 1
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