mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-20 16:38:22 +08:00
Added test for #9596
This commit is contained in:
@@ -389,4 +389,23 @@ class UrlManagerTest extends TestCase
|
||||
|
||||
unset($_SERVER['REQUEST_METHOD']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if hash-anchor present for
|
||||
*
|
||||
* https://github.com/yiisoft/yii2/pull/9596
|
||||
*/
|
||||
public function testHash()
|
||||
{
|
||||
$manager = new UrlManager([
|
||||
'enablePrettyUrl' => true,
|
||||
'cache' => null,
|
||||
'rules' => [
|
||||
],
|
||||
'hostInfo' => 'http://example.com',
|
||||
'scriptUrl' => '/test',
|
||||
]);
|
||||
$url = $manager->createAbsoluteUrl(['site/index', '#' => 'testhash']);
|
||||
$this->assertEquals('http://example.com/test/site/index#testhash', $url);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user