‪TYPO3CMS  10.4
PageViewHelperTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 use TYPO3\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
21 
25 class ‪PageViewHelperTest extends ViewHelperBaseTestcase
26 {
30  protected ‪$viewHelper;
31 
35  protected function ‪setUp(): void
36  {
37  parent::setUp();
38  $uriBuilder = $this->createMock(UriBuilder::class);
39  $this->controllerContext->expects(self::any())->method('getUriBuilder')->willReturn($uriBuilder);
40  $this->viewHelper = $this->getAccessibleMock(PageViewHelper::class, ['renderChildren']);
41  $this->injectDependenciesIntoViewHelper($this->viewHelper);
42  }
43 
48  {
49  $this->viewHelper->setRenderChildrenClosure(
50  function () {
51  return 'index.php';
52  }
53  );
54  $this->setArgumentsUnderTest(
55  $this->viewHelper,
56  []
57  );
58  $this->viewHelper->initializeArgumentsAndRender();
59  }
60 
65  {
66  $this->viewHelper->setRenderChildrenClosure(
67  function () {
68  return null;
69  }
70  );
71  $this->setArgumentsUnderTest(
72  $this->viewHelper,
73  []
74  );
75  $this->viewHelper->initializeArgumentsAndRender();
76  }
77 }
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Uri
Definition: EmailViewHelperTest.php:16
‪TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder
Definition: UriBuilder.php:39
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Uri\PageViewHelperTest\$viewHelper
‪PageViewHelper $viewHelper
Definition: PageViewHelperTest.php:29
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Uri\PageViewHelperTest\setUp
‪setUp()
Definition: PageViewHelperTest.php:34
‪TYPO3\CMS\Fluid\ViewHelpers\Uri\PageViewHelper
Definition: PageViewHelper.php:64
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Uri\PageViewHelperTest\renderProvidesUriForValidLinkTarget
‪renderProvidesUriForValidLinkTarget()
Definition: PageViewHelperTest.php:46
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Uri\PageViewHelperTest\renderWillNotProvideUriForNonValidLinkTarget
‪renderWillNotProvideUriForNonValidLinkTarget()
Definition: PageViewHelperTest.php:63
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Uri\PageViewHelperTest
Definition: PageViewHelperTest.php:26