diff options
Diffstat (limited to 'tests/Url/UrlTest.php')
-rw-r--r-- | tests/Url/UrlTest.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/Url/UrlTest.php b/tests/Url/UrlTest.php index e498d79e..425327ed 100644 --- a/tests/Url/UrlTest.php +++ b/tests/Url/UrlTest.php | |||
@@ -145,4 +145,33 @@ class UrlTest extends PHPUnit_Framework_TestCase | |||
145 | $url = new Url('git://domain.tld/push?pull=clone#checkout'); | 145 | $url = new Url('git://domain.tld/push?pull=clone#checkout'); |
146 | $this->assertEquals('git', $url->getScheme()); | 146 | $this->assertEquals('git', $url->getScheme()); |
147 | } | 147 | } |
148 | |||
149 | /** | ||
150 | * Test add trailing slash. | ||
151 | */ | ||
152 | function testAddTrailingSlash() | ||
153 | { | ||
154 | $strOn = 'http://randomstr.com/test/'; | ||
155 | $strOff = 'http://randomstr.com/test'; | ||
156 | $this->assertEquals($strOn, add_trailing_slash($strOn)); | ||
157 | $this->assertEquals($strOn, add_trailing_slash($strOff)); | ||
158 | } | ||
159 | |||
160 | /** | ||
161 | * Test valid HTTP url. | ||
162 | */ | ||
163 | function testUrlIsHttp() | ||
164 | { | ||
165 | $url = new Url(self::$baseUrl); | ||
166 | $this->assertTrue($url->isHttp()); | ||
167 | } | ||
168 | |||
169 | /** | ||
170 | * Test non HTTP url. | ||
171 | */ | ||
172 | function testUrlIsNotHttp() | ||
173 | { | ||
174 | $url = new Url('ftp://save.tld/mysave'); | ||
175 | $this->assertFalse($url->isHttp()); | ||
176 | } | ||
148 | } | 177 | } |