test: add spark routes test for route with regexp

This commit is contained in:
kenjis 2024-06-19 12:29:48 +09:00
parent 19d5755cbc
commit 6107a60591
No known key found for this signature in database
GPG Key ID: BD254878922AF198

View File

@ -240,4 +240,18 @@ final class RoutesTest extends CIUnitTestCase
EOL;
$this->assertStringContainsString($expected, $this->getBuffer());
}
public function testRoutesCommandRouteWithRegexp(): void
{
$routes = Services::routes();
$routes->resetRoutes();
$routes->options('picker/(.+)', 'Options::index');
command('routes');
$expected = <<<'EOL'
| OPTIONS | picker/(.+) | » | \App\Controllers\Options::index | <unknown> | <unknown> |
EOL;
$this->assertStringContainsString($expected, $this->getBuffer());
}
}