Fix errors in the router

This commit is contained in:
2017-09-04 11:02:25 +07:00
parent 128d337383
commit bfdd632adf
4 changed files with 21 additions and 8 deletions

View File

@@ -6,6 +6,8 @@ class RouterTest extends \PHPUnit\Framework\TestCase
/**
* Data provider for matchingRouteSuccess
*
* Contains: route, params, $_SERVER['REQUEST_URI'], expected_params
*
* @return array
*/
public function routeProvider()
@@ -13,15 +15,15 @@ class RouterTest extends \PHPUnit\Framework\TestCase
return [
[
'',
['controller' => 'home', 'action' => 'index'],
['controller' => 'posts', 'action' => 'index'],
'',
['controller' => 'home', 'action' => 'index']
['controller' => 'posts', 'action' => 'index']
],
[
'{controller}/{action}',
[],
'posts/new',
['controller' => 'posts', 'action' => 'new']
'posts/entry',
['controller' => 'posts', 'action' => 'entry']
],
[
'{controller}/{action}/{id:\d+}',