url = '/not-found'; Flight::route('/', function () { echo 'hello world!'; }); Flight::start(); $this->expectOutputString('[]'); $this->assertEquals(404, Flight::response()->status()); $this->assertEquals('[]', Flight::response()->getBody()); } public function testMapErrorMethod(): void { Flight::map('error', function (Throwable $error) { // Handle error echo 'Custom: ' . $error->getMessage(); }); Flight::app()->handleException(new Exception('Error')); $this->expectOutputString('Custom: Error'); } public function testGetRouterStatically(): void { $router = Flight::router(); Flight::request()->method = 'GET'; Flight::request()->url = '/'; $router->get('/', static function () { Flight::response()->write('from resp '); }); Flight::start(); $this->expectOutputString('from resp '); } }