Skip to content

Commit

Permalink
Add unit test cases for joomla#4362
Browse files Browse the repository at this point in the history
  • Loading branch information
mbabker authored and piotr-cz committed Oct 6, 2014
1 parent fa64d22 commit a439fe1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unit/suites/libraries/joomla/string/JStringPunycodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public function testUrlToPunycode()
'http://xn--au-gr-de-nos-plumes-fzb.fr',
'Tests punycode encoding a UTF8 url in French'
);

$this->assertEquals(
JStringPunycode::urlToPunycode('http://www.джумла-тест.рф#test'),
'http://www.xn----7sblgc4ag8bhcd.xn--p1ai#test',
'Tests punycode encoding a UTF8 url in Cyrillic with an anchor (See GitHub #4362)'
);
}

/**
Expand All @@ -103,6 +109,12 @@ public function testUrlToUTF8()
'http://au-gré-de-nos-plumes.fr',
'Tests punycode decoding a UTF8 url in French'
);

$this->assertEquals(
JStringPunycode::urlToUTF8('http://www.xn----7sblgc4ag8bhcd.xn--p1ai#test'),
'http://www.джумла-тест.рф#test',
'Tests punycode decoding a UTF8 url in Cyrillic with an anchor (See GitHub #4362)'
);
}

/**
Expand Down

0 comments on commit a439fe1

Please sign in to comment.