]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/Url/UrlTest.php
Fixes #531 - Title retrieving is failing with multiple use case
[github/shaarli/Shaarli.git] / tests / Url / UrlTest.php
index a64a73eae183e82672e3647c8a8249cdfa26c189..5fdc86177bdf9677317719b6f8f516fa5e89f351 100644 (file)
@@ -181,4 +181,19 @@ class UrlTest extends PHPUnit_Framework_TestCase
         $url = new Url('ftp://save.tld/mysave');
         $this->assertFalse($url->isHttp());
     }
+
+    /**
+     * Test IndToAscii.
+     */
+    function testIndToAscii()
+    {
+        $ind = 'http://www.académie-française.fr/';
+        $expected = 'http://www.xn--acadmie-franaise-npb1a.fr/';
+        $url = new Url($ind);
+        $this->assertEquals($expected, $url->indToAscii());
+
+        $notInd = 'http://www.academie-francaise.fr/';
+        $url = new Url($notInd);
+        $this->assertEquals($notInd, $url->indToAscii());
+    }
 }