‪TYPO3CMS  10.4
AbstractTemplateViewTest.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\Core\AccessibleObjectInterface;
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
22 use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer;
23 
27 class ‪AbstractTemplateViewTest extends UnitTestCase
28 {
32  protected ‪$view;
33 
37  protected ‪$renderingContext;
38 
43 
47  protected function ‪setUp(): void
48  {
49  parent::setUp();
50  $this->viewHelperVariableContainer = $this->getMockBuilder(ViewHelperVariableContainer::class)
51  ->setMethods(['setView'])
52  ->getMock();
53  $this->renderingContext = $this->getMockBuilder(RenderingContext::class)
54  ->setMethods(['getViewHelperVariableContainer'])
55  ->disableOriginalConstructor()
56  ->getMock();
57  $this->renderingContext->expects(self::any())->method('getViewHelperVariableContainer')->willReturn($this->viewHelperVariableContainer);
58  $this->view = $this->getAccessibleMock(AbstractTemplateView::class, ['dummy'], [], '', false);
59  $this->view->setRenderingContext($this->renderingContext);
60  }
61 
66  {
67  $this->viewHelperVariableContainer->expects(self::once())->method('setView')->with($this->view);
68  $this->view->setRenderingContext($this->renderingContext);
69  }
70 }
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\$renderingContext
‪RenderingContext PHPUnit Framework MockObject MockObject $renderingContext
Definition: AbstractTemplateViewTest.php:35
‪TYPO3\CMS\Fluid\View\AbstractTemplateView
Definition: AbstractTemplateView.php:33
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\$viewHelperVariableContainer
‪ViewHelperVariableContainer PHPUnit Framework MockObject MockObject $viewHelperVariableContainer
Definition: AbstractTemplateViewTest.php:39
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\setUp
‪setUp()
Definition: AbstractTemplateViewTest.php:44
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\viewIsPlacedInViewHelperVariableContainer
‪viewIsPlacedInViewHelperVariableContainer()
Definition: AbstractTemplateViewTest.php:62
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest
Definition: AbstractTemplateViewTest.php:28
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\$view
‪AbstractTemplateView AccessibleObjectInterface $view
Definition: AbstractTemplateViewTest.php:31
‪TYPO3\CMS\Fluid\Core\Rendering\RenderingContext
Definition: RenderingContext.php:39
‪TYPO3\CMS\Fluid\Tests\Unit\View
Definition: AbstractTemplateViewTest.php:16