public function setUp() { $this->objectFactory = $this->getMock('F3\\FLOW3\\Object\\ObjectFactoryInterface', array(), array(), '', FALSE); $this->packageManager = $this->getMock('F3\\FLOW3\\Package\\PackageManagerInterface', array(), array(), '', FALSE); $this->resourceManager = $this->getMock('F3\\FLOW3\\Resource\\ResourceManager', array(), array(), '', FALSE); $this->objectManager = $this->getMock('F3\\FLOW3\\Object\\ObjectManagerInterface', array(), array(), '', FALSE); $this->view = new \F3\FLOW3\MVC\View\StandardView($this->objectFactory, $this->packageManager, $this->resourceManager, $this->objectManager); $this->controllerContext = $this->getMock('F3\\FLOW3\\MVC\\Controller\\Context', array('getRequest'), array(), '', FALSE); $this->view->setControllerContext($this->controllerContext); }
public function setUp() { \vfsStreamWrapper::register(); \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('testDirectory')); $this->objectFactory = $this->getMock('F3\\FLOW3\\Object\\ObjectFactoryInterface', array(), array(), '', FALSE); $this->packageManager = $this->getMock('F3\\FLOW3\\Package\\PackageManagerInterface', array(), array(), '', FALSE); $this->resourceManager = $this->getMock('F3\\FLOW3\\Resource\\ResourceManager', array(), array(), '', FALSE); $this->objectManager = $this->getMock('F3\\FLOW3\\Object\\ObjectManagerInterface', array(), array(), '', FALSE); $this->view = $this->getMock('F3\\FLOW3\\MVC\\View\\NotFoundView', array('getTemplatePathAndFilename'), array($this->objectFactory, $this->packageManager, $this->resourceManager, $this->objectManager)); $this->controllerContext = $this->getMock('F3\\FLOW3\\MVC\\Controller\\Context', array('getRequest'), array(), '', FALSE); $this->view->setControllerContext($this->controllerContext); }
/** * Processes a generic request and fills the response with the default view * * @param \F3\FLOW3\MVC\RequestInterface $request The request * @param \F3\FLOW3\MVC\ResponseInterface $response The response * @return void * @author Robert Lemke <*****@*****.**> * @author Karsten Dambekalns <*****@*****.**> * @api */ public function processRequest(\F3\FLOW3\MVC\RequestInterface $request, \F3\FLOW3\MVC\ResponseInterface $response) { parent::processRequest($request, $response); $this->notFoundView->setControllerContext($this->controllerContext); if ($this->exception !== NULL) { $this->notFoundView->assign('errorMessage', $this->exception->getMessage()); } switch (get_class($request)) { case 'F3\\FLOW3\\MVC\\Web\\Request': $response->setStatus(404); $response->setContent($this->notFoundView->render()); break; default: $response->setContent("\n404 Not Found\n\n" . "No controller could be resolved which would match your request.\n"); } }