public function test500() { $this->app->route('500', '/500', function () { throw new \Exception('Test Exception for 500'); }); $this->app->demand('header', function ($header) use(&$headers_list) { $headers_list[] = $header; }); $this->app->simulate_request('/500'); var_dump($headers_list); $this->assertNotEmpty($headers_list); $this->assertContains('HTTP/1.1 500 Internal Server Error', $headers_list); }