Typo3Test   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 14
dl 0
loc 22
rs 10
c 2
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A testRender() 0 20 2
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2017-2025
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' )->willReturn( '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