X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fjson%2FFormatJsonTest.php;h=a6adf343d5af32df976312461280b82eca0c4c60;hb=ca31b7f793df5ef6d1fc31b4a43c88313067b619;hp=2760cb9f22906f6f27ea09745c8b3198f6561a90;hpb=2d24bc6b9a6aa055897e74e187838b3fc272d4b7;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/json/FormatJsonTest.php b/tests/phpunit/includes/json/FormatJsonTest.php index 2760cb9f22..a6adf343d5 100644 --- a/tests/phpunit/includes/json/FormatJsonTest.php +++ b/tests/phpunit/includes/json/FormatJsonTest.php @@ -109,6 +109,15 @@ class FormatJsonTest extends MediaWikiTestCase { ); } + public function testEncodeFail() { + // Set up a recursive object that can't be encoded. + $a = new stdClass; + $b = new stdClass; + $a->b = $b; + $b->a = $a; + $this->assertFalse( FormatJson::encode( $a ) ); + } + public function testDecodeReturnType() { $this->assertInternalType( 'object',