Passed
Push — master ( fa79ba...4fcbee )
by Aimeos
08:39 queued 05:58
created

T3RouterTest::tearDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 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-2022
7
 */
8
9
10
namespace Aimeos\Base\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
		if( !interface_exists( '\TYPO3\CMS\Core\Routing\RouterInterface' ) ) {
21
			$this->markTestSkipped( 'TYPO3 Router not available' );
22
		}
23
24
		$this->view = new \Aimeos\Base\View\Standard();
25
	}
26
27
28
	protected function tearDown() : void
29
	{
30
		unset( $this->view );
31
	}
32
33
34
	public function testTransform()
35
	{
36
		$mock = $this->getMockBuilder( 'TYPO3\CMS\Core\Routing\RouterInterface' )
37
			->setMethods( array( 'generateUri', 'matchRequest' ) )->getMock();
38
39
		$stub = $this->getMockBuilder( 'Psr\Http\Message\UriInterface' )->getMock();
40
41
		$mock->expects( $this->once() )->method( 'generateUri' )->will( $this->returnValue( $stub ) );
42
43
		$object = new \Aimeos\Base\View\Helper\Url\T3Router( $this->view, $mock, [] );
44
45
		$this->assertEquals( '', $object->transform() );
46
	}
47
}
48