mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-14 09:43:42 +03:00
Development
- Optimized the way parameters are parsed as a result, simple-router now supports routes like `/{param1}-{param2}.json`.
- Replaced reg-ex for parameter-matching with `\w` which means that default parameter matching on routes now include `_` (underscore) per default.
- Simplified `MiddlewareTest` class.
This commit is contained in:
@@ -20,17 +20,16 @@ class MiddlewareTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
\Pecee\SimpleRouter\SimpleRouter::get('/my/test/url', 'DummyController@start', ['middleware' => 'DummyMiddleware']);
|
||||
|
||||
$found = false;
|
||||
|
||||
try {
|
||||
\Pecee\SimpleRouter\SimpleRouter::start();
|
||||
}catch(Exception $e) {
|
||||
$this->assertTrue(($e instanceof MiddlewareLoadedException));
|
||||
return;
|
||||
$found = ($e instanceof MiddlewareLoadedException);
|
||||
}
|
||||
|
||||
throw new Exception('Middleware not loaded');
|
||||
$this->assertTrue($found);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user