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:
Simon Sessingø
2016-06-04 15:12:04 +02:00
parent b540c01650
commit 6780b24e59
3 changed files with 15 additions and 8 deletions

View File

@@ -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);
}
}