From 5ab89da146929734a39c7a55619b8bf8298ab832 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 12 Aug 2025 18:02:39 +0200 Subject: implement phpunit integration tests --- src/Router.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Router.php') diff --git a/src/Router.php b/src/Router.php index 319d5e2..e0b09ad 100644 --- a/src/Router.php +++ b/src/Router.php @@ -24,6 +24,10 @@ class Router $this->addRoutes(); } + /** + * match the current url against the routes. + * also add preflight CORS headers on OPTIONS requests. + */ public function run(): Response { $request = Request::createFromGlobals(); @@ -55,6 +59,9 @@ class Router } } + /** + * add routes from the routes file + */ private function addRoutes(): void { $routes = include_once(__DIR__ . "/routes.php"); -- cgit v1.2.3