Passed
Push — 2020.04 ( 054a6e...097e5e )
by Aimeos
02:55 queued 11s
created

T3RouterTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 10
c 1
b 0
f 0
dl 0
loc 29
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 3 1
A testTransform() 0 12 1
A tearDown() 0 3 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-2020
7
 */
8
9
10
namespace Aimeos\MW\View\Helper\Url;
11
12
13
class T3RouterTest extends \PHPUnit\Framework\TestCase
14
{
15
	private $view;
16
17
18
	protected function setUp() : void
19
	{
20
		$this->view = new \Aimeos\MW\View\Standard();
21
	}
22
23
24
	protected function tearDown() : void
25
	{
26
		unset( $this->view );
27
	}
28
29
30
	public function testTransform()
31
	{
32
		$mock = $this->getMockBuilder( 'TYPO3\CMS\Core\Routing\RouterInterface' )
33
			->setMethods( array( 'generateUri', 'matchRequest' ) )->getMock();
34
35
		$stub = $this->getMockBuilder( 'Psr\Http\Message\UriInterface' )->getMock();
36
37
		$mock->expects( $this->once() )->method( 'generateUri' )->will( $this->returnValue( $stub ) );
38
39
		$object = new \Aimeos\MW\View\Helper\Url\T3Router( $this->view, $mock, [] );
40
41
		$this->assertEquals( '', $object->transform() );
42
	}
43
}
44