From db024b9588cf9cdb4e39f9e95607dcbb4efcc9cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sessing=C3=B8?= Date: Mon, 6 Mar 2017 02:21:13 +0100 Subject: [PATCH] Added simular routes PHPUnit test --- test/RouterUrlTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/RouterUrlTest.php b/test/RouterUrlTest.php index 8d872ce..2799e49 100644 --- a/test/RouterUrlTest.php +++ b/test/RouterUrlTest.php @@ -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