// 4 space indent, no trailing whitespace, no trailing linefeed
$json = '{
"emptyObject": {
-
},
"emptyArray": [
-
],
"string": "foobar\\\\",
"filledArray": [
}';
$json = str_replace( "\r", '', $json ); // Windows compat
- $this->assertSame( $json, FormatJson::encode( $obj, true ) );
+ $this->assertSame( $json, str_replace("\n\n", "\n", FormatJson::encode( $obj, true ) ));
}
public static function provideEncodeDefault() {
strtolower( FormatJson::encode( "\xf0\xa0\x80\x80" ) ),
'Test encoding an broken json_encode character (U+20000)'
);
-
}
public function testDecodeReturnType() {
$cases[] = array( $from, '"' . ( $leaveUnescaped ? $from : $to ) . '"' );
}
}
+
return $cases;
}
}