‪TYPO3CMS  11.5
AbstractTemplateViewTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
22 use TYPO3\TestingFramework\Core\AccessibleObjectInterface;
23 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
24 use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer;
25 
29 class ‪AbstractTemplateViewTest extends UnitTestCase
30 {
34  protected ‪$view;
35 
39  protected ‪$renderingContext;
40 
45 
49  protected function ‪setUp(): void
50  {
51  parent::setUp();
52  $this->viewHelperVariableContainer = $this->getMockBuilder(ViewHelperVariableContainer::class)
53  ->onlyMethods(['setView'])
54  ->getMock();
55  $this->renderingContext = $this->getMockBuilder(RenderingContext::class)
56  ->onlyMethods(['getViewHelperVariableContainer'])
57  ->disableOriginalConstructor()
58  ->getMock();
59  $this->renderingContext->method('getViewHelperVariableContainer')->willReturn($this->viewHelperVariableContainer);
60  $this->view = $this->getAccessibleMock(AbstractTemplateView::class, ['dummy'], [], '', false);
61  $this->view->setRenderingContext($this->renderingContext);
62  }
63 
67  public function ‪viewIsPlacedInViewHelperVariableContainer(): void
68  {
69  $this->viewHelperVariableContainer->expects(self::once())->method('setView')->with($this->view);
70  $this->view->setRenderingContext($this->renderingContext);
71  }
72 }
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\$renderingContext
‪RenderingContext PHPUnit Framework MockObject MockObject $renderingContext
Definition: AbstractTemplateViewTest.php:37
‪TYPO3\CMS\Fluid\View\AbstractTemplateView
Definition: AbstractTemplateView.php:35
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\$viewHelperVariableContainer
‪ViewHelperVariableContainer PHPUnit Framework MockObject MockObject $viewHelperVariableContainer
Definition: AbstractTemplateViewTest.php:41
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\setUp
‪setUp()
Definition: AbstractTemplateViewTest.php:46
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\viewIsPlacedInViewHelperVariableContainer
‪viewIsPlacedInViewHelperVariableContainer()
Definition: AbstractTemplateViewTest.php:64
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest
Definition: AbstractTemplateViewTest.php:30
‪TYPO3\CMS\Fluid\Tests\Unit\View\AbstractTemplateViewTest\$view
‪AbstractTemplateView AccessibleObjectInterface $view
Definition: AbstractTemplateViewTest.php:33
‪TYPO3\CMS\Fluid\Core\Rendering\RenderingContext
Definition: RenderingContext.php:37
‪TYPO3\CMS\Fluid\Tests\Unit\View
Definition: AbstractTemplateViewTest.php:18