‪TYPO3CMS  9.5
AbstractTemplateViewTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
18 use TYPO3\TestingFramework\Core\AccessibleObjectInterface;
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 use TYPO3\TestingFramework\Fluid\Unit\Core\Rendering\RenderingContextFixture;
21 use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer;
22 
26 class ‪AbstractTemplateViewTest extends UnitTestCase
27 {
31  protected ‪$view;
32 
36  protected ‪$renderingContext;
37 
42 
46  protected function ‪setUp()
47  {
48  $this->viewHelperVariableContainer = $this->getMockBuilder(ViewHelperVariableContainer::class)
49  ->setMethods(['setView'])
50  ->getMock();
51  $this->renderingContext = $this->getMockBuilder(RenderingContextFixture::class)
52  ->setMethods(['getViewHelperVariableContainer'])
53  ->getMock();
54  $this->renderingContext->expects($this->any())->method('getViewHelperVariableContainer')->will($this->returnValue($this->viewHelperVariableContainer));
55  $this->view = $this->getAccessibleMock(AbstractTemplateView::class, ['dummy'], [], '', false);
56  $this->view->setRenderingContext($this->renderingContext);
57  }
58 
63  {
64  $this->viewHelperVariableContainer->expects($this->once())->method('setView')->with($this->view);
65  $this->view->setRenderingContext($this->renderingContext);
66  }
67 }
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\$viewHelperVariableContainer
‪ViewHelperVariableContainer PHPUnit_Framework_MockObject_MockObject $viewHelperVariableContainer
Definition: AbstractTemplateViewTest.php:38
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\$renderingContext
‪RenderingContext PHPUnit_Framework_MockObject_MockObject $renderingContext
Definition: AbstractTemplateViewTest.php:34
‪TYPO3\CMS\Fluid\View\AbstractTemplateView
Definition: AbstractTemplateView.php:30
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\setUp
‪setUp()
Definition: AbstractTemplateViewTest.php:43
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\viewIsPlacedInViewHelperVariableContainer
‪viewIsPlacedInViewHelperVariableContainer()
Definition: AbstractTemplateViewTest.php:59
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest
Definition: AbstractTemplateViewTest.php:27
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\$view
‪AbstractTemplateView AccessibleObjectInterface $view
Definition: AbstractTemplateViewTest.php:30
‪TYPO3\CMS\Fluid\Core\Rendering\RenderingContext
Definition: RenderingContext.php:36
‪TYPO3\CMS\Fluid\Tests\Unit\View
Definition: AbstractTemplateViewTest.php:2