mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 08:47:52 +00:00
Development
- Fixed DebugHandler::fireEvent not providing correct arguments when calling fireEvents. - Fixed custom regex setMatch not setting parsed parameters correctly (issue: #566). - Added unit-tests for catching issue in the future. - Added php-stan typehints.
This commit is contained in:
@@ -181,6 +181,22 @@ class RouterUrlTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$output = TestRouter::debugOutput('/admin/asd/bec/123', 'get');
|
||||
$this->assertEquals('match', $output);
|
||||
|
||||
TestRouter::router()->reset();
|
||||
}
|
||||
|
||||
public function testCustomRegexWithParameter()
|
||||
{
|
||||
TestRouter::request()->setHost('google.com');
|
||||
|
||||
$results = '';
|
||||
|
||||
TestRouter::get('/tester/{param}', function ($param = null) use($results) {
|
||||
return $results = $param;
|
||||
})->setMatch('/(.*)/i');
|
||||
|
||||
$output = TestRouter::debugOutput('/tester/abepik/ko');
|
||||
$this->assertEquals('/tester/abepik/ko/', $output);
|
||||
}
|
||||
|
||||
public function testRenderMultipleRoutesDisabled()
|
||||
|
||||
Reference in New Issue
Block a user