]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/Url/UrlTest.php
Fixes #410 - Retrieve title fails in multiple cases
[github/shaarli/Shaarli.git] / tests / Url / UrlTest.php
index af6daaa4df844a46b2476f8eaa143b30ed3189c7..425327ed02b37b7f1ccb638208ddf404ed7b16d5 100644 (file)
@@ -156,4 +156,22 @@ class UrlTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($strOn, add_trailing_slash($strOn));
         $this->assertEquals($strOn, add_trailing_slash($strOff));
     }
+
+    /**
+     * Test valid HTTP url.
+     */
+    function testUrlIsHttp()
+    {
+        $url = new Url(self::$baseUrl);
+        $this->assertTrue($url->isHttp());
+    }
+
+    /**
+     * Test non HTTP url.
+     */
+    function testUrlIsNotHttp()
+    {
+        $url = new Url('ftp://save.tld/mysave');
+        $this->assertFalse($url->isHttp());
+    }
 }