mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
Custom regex fix
- Fixed issue with custom-regex maching both host-name and url (issue: #503). - Changed TestRouter so host-name is always set.
This commit is contained in:
@@ -171,4 +171,16 @@ class RouterUrlTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
}
|
||||
|
||||
public function testCustomRegex()
|
||||
{
|
||||
TestRouter::request()->setHost('google.com');
|
||||
|
||||
TestRouter::get('/admin/', function() {
|
||||
return 'match';
|
||||
})->setMatch('/^\/admin\/?(.*)/i');
|
||||
|
||||
$output = TestRouter::debugOutput('/admin/asd/bec/123', 'get');
|
||||
$this->assertEquals('match', $output);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user