|
|
|
@ -14,9 +14,9 @@ class UrlManagerTest extends \yiiunit\TestCase
|
|
|
|
|
'cache' => null, |
|
|
|
|
)); |
|
|
|
|
$url = $manager->createUrl('post/view'); |
|
|
|
|
$this->assertEquals('/?r=post/view', $url); |
|
|
|
|
$this->assertEquals('?r=post/view', $url); |
|
|
|
|
$url = $manager->createUrl('post/view', array('id' => 1, 'title' => 'sample post')); |
|
|
|
|
$this->assertEquals('/?r=post/view&id=1&title=sample+post', $url); |
|
|
|
|
$this->assertEquals('?r=post/view&id=1&title=sample+post', $url); |
|
|
|
|
|
|
|
|
|
// default setting with '/test/' as base url |
|
|
|
|
$manager = new UrlManager(array( |
|
|
|
@ -24,7 +24,7 @@ class UrlManagerTest extends \yiiunit\TestCase
|
|
|
|
|
'cache' => null, |
|
|
|
|
)); |
|
|
|
|
$url = $manager->createUrl('post/view', array('id' => 1, 'title' => 'sample post')); |
|
|
|
|
$this->assertEquals('/test/?r=post/view&id=1&title=sample+post', $url); |
|
|
|
|
$this->assertEquals('/test?r=post/view&id=1&title=sample+post', $url); |
|
|
|
|
|
|
|
|
|
// pretty URL without rules |
|
|
|
|
$manager = new UrlManager(array( |
|
|
|
@ -112,7 +112,7 @@ class UrlManagerTest extends \yiiunit\TestCase
|
|
|
|
|
'cache' => null, |
|
|
|
|
)); |
|
|
|
|
$url = $manager->createAbsoluteUrl('post/view', array('id' => 1, 'title' => 'sample post')); |
|
|
|
|
$this->assertEquals('http://www.example.com/?r=post/view&id=1&title=sample+post', $url); |
|
|
|
|
$this->assertEquals('http://www.example.com?r=post/view&id=1&title=sample+post', $url); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function testParseRequest() |
|
|
|
|