Added simular routes PHPUnit test

This commit is contained in:
Simon Sessingø
2017-03-06 02:21:13 +01:00
parent ff3f1bdcdd
commit db024b9588

View File

@@ -8,6 +8,21 @@ require_once 'Helpers/TestRouter.php';
class RouterUrlTest extends PHPUnit_Framework_TestCase
{
public function testSimularUrls()
{
SimpleRouter::router()->reset();
SimpleRouter::request()->setMethod('get');
SimpleRouter::request()->setUri('/url1');
// Match normal route on alias
SimpleRouter::resource('/url11', 'DummyController@silent');
SimpleRouter::resource('/url1', 'DummyController@silent', ['as' => 'match']);
SimpleRouter::start();
$this->assertEquals($this->getUrl('match'), $this->getUrl());
}
public function testUrls()
{
// Match normal route on alias