mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
- Fixed domains not being prepending properly to urls.
- Won't prepend subdomain to urls if subdomain is equal to current host. - Url: implemented parse function. - Router: getUrl now parses url to properly parse the subdomain.
This commit is contained in:
@@ -94,11 +94,13 @@ class RouterUrlTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testSimilarUrls()
|
||||
{
|
||||
TestRouter::reset();
|
||||
// Match normal route on alias
|
||||
TestRouter::get('/url11', 'DummyController@method1');
|
||||
TestRouter::get('/url22', 'DummyController@method2');
|
||||
TestRouter::get('/url33', 'DummyController@method2')->name('match');
|
||||
|
||||
|
||||
TestRouter::debugNoReset('/url33', 'get');
|
||||
|
||||
$this->assertEquals(TestRouter::getUrl('match'), TestRouter::getUrl());
|
||||
|
||||
@@ -17,7 +17,7 @@ class TestRouter extends \Pecee\SimpleRouter\SimpleRouter
|
||||
{
|
||||
$request = static::request();
|
||||
|
||||
$request->setUrl((new \Pecee\Http\Url($testUrl))->setHost('local.unitTest'));
|
||||
$request->setUrl((new \Pecee\Http\Url($testUrl)));
|
||||
$request->setMethod($testMethod);
|
||||
|
||||
static::start();
|
||||
|
||||
Reference in New Issue
Block a user