group('/api', function (Router $r): void { $r->get('/health', [\Phred\Http\Controllers\HealthController::class, '__invoke']); }); }); $psr17 = new Psr17Factory(); $creator = new ServerRequestCreator($psr17, $psr17, $psr17, $psr17); $req = $creator->fromGlobals()->withMethod('GET')->withUri($psr17->createUri('/api/health')); $routeInfo = $dispatcher->dispatch($req->getMethod(), $req->getUri()->getPath()); $this->assertSame(Dispatcher::FOUND, $routeInfo[0] ?? null, 'Route in group should be found with prefixed path'); $this->assertIsArray($routeInfo[1] ?? null); } }