TYPO3 CMS  TYPO3_7-6
PageViewHelperTest.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script is part of the TYPO3 project - inspiring people to share! *
6  * *
7  * TYPO3 is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU General Public License version 2 as published by *
9  * the Free Software Foundation. *
10  * *
11  * This script is distributed in the hope that it will be useful, but *
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
13  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
14  * Public License for more details. *
15  * */
16 
18 
23 {
27  protected $viewHelper;
28 
32  protected function setUp()
33  {
34  parent::setUp();
35  $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Link\PageViewHelper::class, ['renderChildren']);
36  $this->injectDependenciesIntoViewHelper($this->viewHelper);
37  $this->viewHelper->initializeArguments();
38  }
39 
44  {
45  $this->uriBuilder->expects($this->once())->method('build')->will($this->returnValue('index.php'));
46  $this->tagBuilder->expects($this->once())->method('render');
47  $this->viewHelper->render();
48  }
49 
54  {
55  $this->uriBuilder->expects($this->once())->method('build')->will($this->returnValue(null));
56  $this->tagBuilder->expects($this->never())->method('render');
57  $this->viewHelper->render();
58  }
59 }
injectDependenciesIntoViewHelper(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper)
getAccessibleMock( $originalClassName, $methods=[], array $arguments=[], $mockClassName='', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true)