Added test for #9596

This commit is contained in:
Alexander Makarov
2015-09-05 01:04:35 +03:00
parent fbce0c0450
commit 6f0bb29e7a

View File

@@ -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);
}
}