]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/Url/UrlTest.php
Url: introduce global helper functions for cleanup and scheme detection
[github/shaarli/Shaarli.git] / tests / Url / UrlTest.php
similarity index 85%
rename from tests/UrlTest.php
rename to tests/Url/UrlTest.php
index c848e88e8c0cf6c2e4a7bd5eaf5eafcea687a30f..e498d79e8ed8dbf9057ce88c04fd1e98143a5408 100755 (executable)
@@ -5,30 +5,6 @@
 
 require_once 'application/Url.php';
 
-/**
- * Unitary tests for unparse_url()
- */
-class UnparseUrlTest extends PHPUnit_Framework_TestCase
-{
-    /**
-     * Thanks for building nothing
-     */
-    public function testUnparseEmptyArray()
-    {
-        $this->assertEquals('', unparse_url(array()));
-    }
-
-    /**
-     * Rebuild a full-featured URL
-     */
-    public function testUnparseFull()
-    {
-        $ref = 'http://username:password@hostname:9090/path'
-              .'?arg1=value1&arg2=value2#anchor';
-        $this->assertEquals($ref, unparse_url(parse_url($ref)));
-    }
-}
-
 /**
  * Unitary tests for URL utilities
  */
@@ -44,7 +20,7 @@ class UrlTest extends PHPUnit_Framework_TestCase
     {
         $url = new Url(self::$baseUrl.$query.$fragment);
         $url->cleanup();
-        $this->assertEquals(self::$baseUrl, $url->__toString());
+        $this->assertEquals(self::$baseUrl, $url->toString());
     }
 
     /**
@@ -52,7 +28,8 @@ class UrlTest extends PHPUnit_Framework_TestCase
      */
     public function testEmptyConstruct()
     {
-        $this->assertEquals('', new Url(''));
+        $url = new Url('');
+        $this->assertEquals('', $url->toString());
     }
 
     /**
@@ -62,7 +39,8 @@ class UrlTest extends PHPUnit_Framework_TestCase
     {
         $ref = 'http://username:password@hostname:9090/path'
               .'?arg1=value1&arg2=value2#anchor';
-        $this->assertEquals($ref, new Url($ref));
+        $url = new Url($ref);
+        $this->assertEquals($ref, $url->toString());
     }
 
     /**