/** * @param RenderingContextInterface $renderingContext * @return void */ public function setRenderingContext(RenderingContextInterface $renderingContext) { $this->renderingContext = $renderingContext; $this->templateVariableContainer = $renderingContext->getTemplateVariableContainer(); if ($renderingContext->getControllerContext() !== NULL) { $this->controllerContext = $renderingContext->getControllerContext(); } $this->viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer(); }
/** * Injects a fresh rendering context * * @param RenderingContextInterface $renderingContext * @return void */ public function setRenderingContext(RenderingContextInterface $renderingContext) { $this->baseRenderingContext = $renderingContext; $this->baseRenderingContext->getViewHelperVariableContainer()->setView($this); $this->controllerContext = $renderingContext->getControllerContext(); }
/** * @test */ public function controllerContextCanBeReadCorrectly() { $controllerContext = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext', array(), array(), '', FALSE); $this->renderingContext->setControllerContext($controllerContext); $this->assertSame($this->renderingContext->getControllerContext(), $controllerContext); }
/** * @test */ public function controllerContextCanBeReadCorrectly() { $controllerContext = $this->getMock(\TYPO3\Flow\Mvc\Controller\ControllerContext::class, array(), array(), '', false); $this->renderingContext->setControllerContext($controllerContext); $this->assertSame($this->renderingContext->getControllerContext(), $controllerContext); }
/** * @test */ public function controllerContextCanBeReadCorrectly() { $controllerContext = $this->getMockBuilder(\TYPO3\Flow\Mvc\Controller\ControllerContext::class)->disableOriginalConstructor()->getMock(); $this->renderingContext->setControllerContext($controllerContext); $this->assertSame($this->renderingContext->getControllerContext(), $controllerContext); }