From 00f432ab65d400cdf5c19301d1fe61d72951e08e Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Wed, 23 Sep 2015 15:47:51 +0300 Subject: [PATCH] Fixes #9747: added tests for Url::isRelative() --- tests/framework/helpers/UrlTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/framework/helpers/UrlTest.php b/tests/framework/helpers/UrlTest.php index 463036210f..d634ec41d4 100644 --- a/tests/framework/helpers/UrlTest.php +++ b/tests/framework/helpers/UrlTest.php @@ -205,4 +205,13 @@ class UrlTest extends TestCase $this->assertEquals('http://example.com/base/index.php?r=page%2Fview&id=10', Url::canonical()); $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/')); + } }