This commit is contained in:
Simon Sessingø
2016-11-28 04:20:34 +01:00
parent 74351e0330
commit d9b97ccf42
10 changed files with 74 additions and 132 deletions
+20 -10
View File
@@ -14,6 +14,26 @@ class RouterRouteTest extends PHPUnit_Framework_TestCase
{
protected $result = false;
public function testMultiParam()
{
SimpleRouter::router()->reset();
SimpleRouter::request()->setMethod('get');
SimpleRouter::request()->setUri('/test-param1-param2');
SimpleRouter::get('/test-{param1}-{param2}', function($param1, $param2) {
if($param1 === 'param1' && $param2 === 'param2') {
$this->result = true;
}
});
SimpleRouter::start();
$this->assertTrue($this->result);
}
/**
* Redirects to another route through 3 exception handlers.
*
@@ -118,16 +138,6 @@ class RouterRouteTest extends PHPUnit_Framework_TestCase
SimpleRouter::start();
}
public function testMultiParam()
{
SimpleRouter::router()->reset();
SimpleRouter::request()->setMethod('get');
SimpleRouter::request()->setUri('/test-param1-param2');
SimpleRouter::get('/test-{param1}-{param2}', 'DummyController@param');
SimpleRouter::start();
}
public function testPathParamRegex()
{
SimpleRouter::router()->reset();