/** * Tests the handling of all other exceptions. */ public function testHandleGenericException() { $headerWrapper = new HeaderWrapper(); $headerWrapper->setEnabled(false); $this->defaultExceptionHandler->setHeaderWrapper($headerWrapper); ob_start(); $this->defaultExceptionHandler->handle(new MalformedUriException()); $output = ob_get_contents(); ob_clean(); $this->assertEquals(500, $headerWrapper->getStatusCode()); }
/** * Tests the compareRequestUri method. */ public function testTest() { foreach ($this->compareRequestUriDataProvider() as $params) { list($requestUri, $controllerName, $methodName, $queryString, $headersExpected) = $params; $headerWrapper = new HeaderWrapper(); $headerWrapper->setEnabled(false); $this->application->setHeaderWrapper($headerWrapper); $this->application->setDefaultController('default'); $this->application->compareRequestUri($requestUri, array('controller' => $controllerName, 'method' => $methodName, 'query_string' => $queryString)); $this->assertEquals(!empty($headersExpected), $headerWrapper->getSent(), 'Unexpected result for: ' . $requestUri . ' (Location: ' . $headerWrapper->getHeader('Location') . ')'); } }