Passed
Push — master ( c4ec89...4f1160 )
by Aimeos
02:45
created

T3View   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 6
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2017-2023
6
 */
7
8
namespace Aimeos\Base\View\Engine;
9
10
11
class Typo3Test extends \PHPUnit\Framework\TestCase
12
{
13
	public function testRender()
14
	{
15
		if( !class_exists( '\TYPO3\CMS\Fluid\View\StandaloneView' ) ) {
16
			$this->markTestSkipped( '\TYPO3\CMS\Fluid\View\StandaloneView not available' );
17
		}
18
19
		$view = $this->getMockBuilder( '\TYPO3\CMS\Fluid\View\StandaloneView' )
20
			->onlyMethods( ['assign', 'assignMultiple', 'render', 'setTemplatePathAndFilename', 'setPartialRootPaths', 'setLayoutRootPaths'] )
21
			->disableOriginalConstructor()
22
			->getMock();
23
24
		$view->expects( $this->once() )->method( 'setTemplatePathAndFilename' );
25
		$view->expects( $this->once() )->method( 'assignMultiple' );
26
		$view->expects( $this->once() )->method( 'assign' );
27
		$view->expects( $this->once() )->method( 'render' )->will( $this->returnValue( 'test' ) );
28
29
		$object = new \Aimeos\Base\View\Engine\Typo3( $view );
30
		$v = new \Aimeos\Base\View\Standard( [] );
31
32
		$this->assertEquals( 'test', $object->render( $v, 'filepath', ['key' => 'value'] ) );
33
	}
34
}
35