TYPO3 CMS  TYPO3_8-7
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  */
20 
24 class AbstractTemplateViewTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
25 {
29  protected $view;
30 
34  protected $renderingContext;
35 
40 
44  protected function setUp()
45  {
46  $this->viewHelperVariableContainer = $this->getMockBuilder(ViewHelperVariableContainer::class)
47  ->setMethods(['setView'])
48  ->getMock();
49  $this->renderingContext = $this->getMockBuilder(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class)
50  ->setMethods(['getViewHelperVariableContainer'])
51  ->getMock();
52  $this->renderingContext->expects($this->any())->method('getViewHelperVariableContainer')->will($this->returnValue($this->viewHelperVariableContainer));
53  $this->view = $this->getAccessibleMock(AbstractTemplateView::class, ['dummy'], [], '', false);
54  $this->view->setRenderingContext($this->renderingContext);
55  }
56 
61  {
62  $this->viewHelperVariableContainer->expects($this->once())->method('setView')->with($this->view);
63  $this->view->setRenderingContext($this->renderingContext);
64  }
65 }