/** * Sets up this test case * * @return void */ public function setUp() { $this->view = $this->getAccessibleMock('Tx_Fluid_View_StandaloneView', array('dummy'), array(), '', FALSE); $this->mockTemplateParser = $this->getMock('Tx_Fluid_Core_Parser_TemplateParser'); $this->mockParsedTemplate = $this->getMock('Tx_Fluid_Core_Parser_ParsedTemplateInterface'); $this->mockTemplateParser->expects($this->any())->method('parse')->will($this->returnValue($this->mockParsedTemplate)); $this->mockConfigurationManager = $this->getMock('Tx_Extbase_Configuration_ConfigurationManagerInterface'); $this->mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManager'); $this->mockObjectManager->expects($this->any())->method('get')->will($this->returnCallback(array($this, 'objectManagerCallback'))); $this->mockObjectManager->expects($this->any())->method('create')->will($this->returnCallback(array($this, 'objectManagerCallback'))); $this->mockRequest = $this->getMock('Tx_Extbase_MVC_Web_Request'); $this->mockUriBuilder = $this->getMock('Tx_Extbase_MVC_Web_Routing_UriBuilder'); $this->mockFlashMessages = $this->getMock('Tx_Extbase_MVC_Controller_FlashMessages'); $this->mockContentObject = $this->getMock('tslib_cObj'); $this->mockControllerContext = $this->getMock('Tx_Extbase_MVC_Controller_ControllerContext'); $this->mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->mockRequest)); $this->mockViewHelperVariableContainer = $this->getMock('Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer'); $this->mockRenderingContext = $this->getMock('Tx_Fluid_Core_Rendering_RenderingContextInterface'); $this->mockRenderingContext->expects($this->any())->method('getControllerContext')->will($this->returnValue($this->mockControllerContext)); $this->mockRenderingContext->expects($this->any())->method('getViewHelperVariableContainer')->will($this->returnValue($this->mockViewHelperVariableContainer)); $this->view->injectTemplateParser($this->mockTemplateParser); $this->view->injectObjectManager($this->mockObjectManager); $this->view->setRenderingContext($this->mockRenderingContext); t3lib_div::setSingletonInstance('Tx_Extbase_Object_ObjectManager', $this->mockObjectManager); t3lib_div::addInstance('tslib_cObj', $this->mockContentObject); }