From: Chad Horohoe Date: Fri, 4 Oct 2013 17:44:26 +0000 (-0700) Subject: Strip excess newlines from formatting test X-Git-Tag: 1.31.0-rc.0~18604^2 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=c370ad21d7f81a04d10b5e488a4f8ec61ef0499c;p=lhc%2Fweb%2Fwiklou.git Strip excess newlines from formatting test The result's basically the same either way, only difference is things like "emptyObject": { }, Are now "emptyObject": { }, Results are still pretty, now passes in both Zend and HHVM Change-Id: I6afa0fd49a7aef3f6b7ca1b4574f3de555521348 --- diff --git a/tests/phpunit/includes/json/FormatJsonTest.php b/tests/phpunit/includes/json/FormatJsonTest.php index ef263c4dd4..eb024aba2a 100644 --- a/tests/phpunit/includes/json/FormatJsonTest.php +++ b/tests/phpunit/includes/json/FormatJsonTest.php @@ -19,10 +19,8 @@ class FormatJsonTest extends MediaWikiTestCase { // 4 space indent, no trailing whitespace, no trailing linefeed $json = '{ "emptyObject": { - }, "emptyArray": [ - ], "string": "foobar\\\\", "filledArray": [ @@ -35,7 +33,7 @@ class FormatJsonTest extends MediaWikiTestCase { }'; $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() {