/** * Sets up this test case * @return void */ public function setUp() { $this->templateVariableContainer = $this->getMock('Tx_Fluid_Core_ViewHelper_TemplateVariableContainer', array('exists', 'remove', 'add')); $this->viewHelperVariableContainer = $this->getMock('Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer', array('setView')); $this->renderingContext = $this->getMock('Tx_Fluid_Core_Rendering_RenderingContext', array('getViewHelperVariableContainer', 'getTemplateVariableContainer')); $this->renderingContext->expects($this->any())->method('getViewHelperVariableContainer')->will($this->returnValue($this->viewHelperVariableContainer)); $this->renderingContext->expects($this->any())->method('getTemplateVariableContainer')->will($this->returnValue($this->templateVariableContainer)); $this->view = $this->getMock('Tx_Fluid_View_AbstractTemplateView', array('getTemplateSource', 'getLayoutSource', 'getPartialSource', 'canRender')); $this->view->setRenderingContext($this->renderingContext); }
/** * Setup fixture * @author Sebastian Kurfürst <*****@*****.**> */ public function setUp() { $this->renderingContext = new Tx_Fluid_Core_Rendering_RenderingContext(); $this->mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface'); $this->renderingContext->injectObjectManager($this->mockObjectManager); $this->templateVariableContainer = $this->getMock('Tx_Fluid_Core_ViewHelper_TemplateVariableContainer'); $this->renderingContext->setTemplateVariableContainer($this->templateVariableContainer); $this->controllerContext = $this->getMock('Tx_Extbase_MVC_Controller_ControllerContext', array(), array(), '', FALSE); $this->renderingContext->setControllerContext($this->controllerContext); $this->viewHelperVariableContainer = $this->getMock('Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer'); $this->renderingContext->setViewHelperVariableContainer($this->viewHelperVariableContainer); }
/** * @test * @author Sebastian Kurfürst <*****@*****.**> */ public function viewHelperVariableContainerCanBeReadCorrectly() { $viewHelperVariableContainer = $this->getMock('Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer'); $this->renderingContext->setViewHelperVariableContainer($viewHelperVariableContainer); $this->assertSame($viewHelperVariableContainer, $this->renderingContext->getViewHelperVariableContainer()); }