url = '/not-found'; Flight::route('/', function () { echo 'hello world!'; }); Flight::start(); ob_get_clean(); $this->assertEquals(404, Flight::response()->status()); $this->assertEquals('[]', Flight::response()->getBody()); } public function testMapErrorMethod() { Flight::map('error', function (Throwable $error) { // Handle error echo 'Custom: ' . $error->getMessage(); }); Flight::app()->handleException(new Exception('Error')); $this->expectOutputString('Custom: Error'); } }