/** * Sets up a request builder for testing * * @return void * @author Robert Lemke <*****@*****.**> */ protected function setUpRequestBuilder() { $this->mockRequestUri = $this->getMock('F3\\FLOW3\\Property\\DataType\\Uri', array(), array(), '', FALSE); $this->mockRequestUri->expects($this->once())->method('getArguments')->will($this->returnValue(array('someArgument' => 'GETArgument'))); $this->mockEnvironment = $this->getMock('F3\\FLOW3\\Utility\\Environment', array(), array(), '', FALSE); $this->mockEnvironment->expects($this->any())->method('getRequestUri')->will($this->returnValue($this->mockRequestUri)); $this->mockRequest = $this->getMock('F3\\FLOW3\\MVC\\Web\\Request', array(), array(), '', FALSE); $this->mockRequest->expects($this->any())->method('getRequestUri')->will($this->returnValue($this->mockRequestUri)); $mockObjectFactory = $this->getMock('F3\\FLOW3\\Object\\ObjectFactoryInterface'); $mockObjectFactory->expects($this->once())->method('create')->will($this->returnValue($this->mockRequest)); $this->mockConfigurationManager = $this->getMock('F3\\FLOW3\\Configuration\\ConfigurationManager', array('getConfiguration'), array(), '', FALSE); $this->mockConfigurationManager->expects($this->once())->method('getConfiguration')->will($this->returnValue(array())); $this->mockRouter = $this->getMock('F3\\FLOW3\\MVC\\Web\\Routing\\RouterInterface', array('route', 'setRoutesConfiguration', 'resolve')); $this->builder = new \F3\FLOW3\MVC\Web\RequestBuilder(); $this->builder->injectObjectFactory($mockObjectFactory); $this->builder->injectEnvironment($this->mockEnvironment); $this->builder->injectConfigurationManager($this->mockConfigurationManager); $this->builder->injectRouter($this->mockRouter); }