mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 08:47:52 +00:00
Parameters are by default now using regex [\w\-]+ (supports dashes) to avoid confusion.
This commit is contained in:
@@ -150,6 +150,21 @@ class RouterRouteTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
public function testParametersWithDashes()
|
||||
{
|
||||
|
||||
$defaultVariable = null;
|
||||
|
||||
TestRouter::get('/my/{path}', function ($path = 'working') use (&$defaultVariable) {
|
||||
$defaultVariable = $path;
|
||||
});
|
||||
|
||||
TestRouter::debug('/my/hello-motto-man');
|
||||
|
||||
$this->assertEquals('hello-motto-man', $defaultVariable);
|
||||
|
||||
}
|
||||
|
||||
public function testParameterDefaultValue()
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user