X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FUrl%2FUrlTest.php;h=0586237211b7a402ea2a9a0f7c0b3749af6b516a;hb=918bd5b9122f929268e0979063c4844e85090858;hp=425327ed02b37b7f1ccb638208ddf404ed7b16d5;hpb=1557cefbd76257ceb830f65806831b490faf0acc;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/Url/UrlTest.php b/tests/Url/UrlTest.php index 425327ed..05862372 100644 --- a/tests/Url/UrlTest.php +++ b/tests/Url/UrlTest.php @@ -85,6 +85,7 @@ class UrlTest extends PHPUnit_Framework_TestCase $this->assertUrlIsCleaned('?utm_term=1n4l'); $this->assertUrlIsCleaned('?xtor=some-url'); + $this->assertUrlIsCleaned('?PHPSESSID=012345678910111213'); } /** @@ -128,6 +129,13 @@ class UrlTest extends PHPUnit_Framework_TestCase self::$baseUrl.'?my=stuff&is=kept#again', $url->cleanup() ); + + // test firefox reader url + $url = new Url( + 'about://reader?url=' . urlencode(self::$baseUrl .'?my=stuff&is=kept') + ); + $this->assertEquals(self::$baseUrl.'?my=stuff&is=kept', $url->cleanup()); + } /** @@ -174,4 +182,19 @@ class UrlTest extends PHPUnit_Framework_TestCase $url = new Url('ftp://save.tld/mysave'); $this->assertFalse($url->isHttp()); } + + /** + * Test International Domain Name to ASCII conversion + */ + function testIdnToAscii() + { + $ind = 'http://www.académie-française.fr/'; + $expected = 'http://www.xn--acadmie-franaise-npb1a.fr/'; + $url = new Url($ind); + $this->assertEquals($expected, $url->idnToAscii()); + + $notInd = 'http://www.academie-francaise.fr/'; + $url = new Url($notInd); + $this->assertEquals($notInd, $url->idnToAscii()); + } }