This repository was archived by the owner on Jan 30, 2020. It is now read-only.
File tree 1 file changed +13
-13
lines changed
1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -960,6 +960,19 @@ public function testJsonPrettyPrintWorksWithArrayNotationInStringLiteral()
960
960
$ this ->assertSame ($ expected , $ pretty );
961
961
}
962
962
963
+ public function testPrettyPrintDoublequoteFollowingEscapedBackslashShouldNotBeTreatedAsEscaped ()
964
+ {
965
+ $ this ->assertEquals (
966
+ "[ \n 1, \n \"\\\\\", \n 3 \n] " ,
967
+ Json \Json::prettyPrint (Json \Json::encode ([1 , '\\' , 3 ]))
968
+ );
969
+
970
+ $ this ->assertEquals (
971
+ "{ \n \"a \": \"\\\\\"\n} " ,
972
+ Json \Json::prettyPrint (Json \Json::encode (['a ' => '\\' ]))
973
+ );
974
+ }
975
+
963
976
public function testPrettyPrintEmptyArray ()
964
977
{
965
978
$ original = <<<JSON
@@ -1058,19 +1071,6 @@ public function testJsonPretty()
1058
1071
$ this ->assertSame ($ original , Json \Json::prettyPrint ($ original ));
1059
1072
}
1060
1073
1061
- public function testPrettyPrintDoublequoteFollowingEscapedBackslashShouldNotBeTreatedAsEscaped ()
1062
- {
1063
- $ this ->assertEquals (
1064
- "[ \n 1, \n \"\\\\\", \n 3 \n] " ,
1065
- Json \Json::prettyPrint (Json \Json::encode ([1 , '\\' , 3 ]))
1066
- );
1067
-
1068
- $ this ->assertEquals (
1069
- "{ \n \"a \": \"\\\\\"\n} " ,
1070
- Json \Json::prettyPrint (Json \Json::encode (['a ' => '\\' ]))
1071
- );
1072
- }
1073
-
1074
1074
public function testPrettyPrintRePrettyPrint ()
1075
1075
{
1076
1076
$ expected = <<<EOB
You can’t perform that action at this time.
0 commit comments