mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-01 23:51:12 +08:00
Fixes #9747: added tests for Url::isRelative()
This commit is contained in:
@@ -205,4 +205,13 @@ class UrlTest extends TestCase
|
|||||||
$this->assertEquals('http://example.com/base/index.php?r=page%2Fview&id=10', Url::canonical());
|
$this->assertEquals('http://example.com/base/index.php?r=page%2Fview&id=10', Url::canonical());
|
||||||
$this->removeMockedAction();
|
$this->removeMockedAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testIsRelative()
|
||||||
|
{
|
||||||
|
$this->assertTrue(Url::isRelative('/test/index.php'));
|
||||||
|
$this->assertTrue(Url::isRelative('index.php'));
|
||||||
|
$this->assertFalse(Url::isRelative('//example.com/'));
|
||||||
|
$this->assertFalse(Url::isRelative('http://example.com/'));
|
||||||
|
$this->assertFalse(Url::isRelative('https://example.com/'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user