Skip to content

Commit

Permalink
Added \v to list of characters to assure correct decoding by PHP decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
padraic committed Jul 11, 2012
1 parent 7a9980f commit d868171
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/Zend/Json/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ public function testString5()
*/
public function testStringOfHtmlSpecialCharsEncodedToUnicodeEscapes()
{
Json\Json::$useBuiltinEncoderDecoder = false;
$expected = '"\\u003C\\u003E\\u0026\\u0027\\u0022"';
$string = '<>&\'"';
$encoded = Json\Encoder::encode($string);
Expand All @@ -181,8 +182,9 @@ public function testStringOfHtmlSpecialCharsEncodedToUnicodeEscapes()
*/
public function testStringOfOtherSpecialCharsEncodedToUnicodeEscapes()
{
$string = "\\ - \n - \t - \r - " .chr(0x08). " - " .chr(0x0C). " - /";
$encoded = '"\u005C - \u000A - \u0009 - \u000D - \u0008 - \u000C - \u002F"';
Json\Json::$useBuiltinEncoderDecoder = false;
$string = "\\ - \n - \t - \r - " .chr(0x08). " - " .chr(0x0C). " - / - \v";
$encoded = '"\u005C - \u000A - \u0009 - \u000D - \u0008 - \u000C - \u002F - \u000B"';
$this->assertEquals($string, Json\Decoder::decode($encoded));
}

Expand Down

0 comments on commit d868171

Please sign in to comment.