Merge "rdbms: avoid LoadBalancer::getConnection waste when using $groups"
[lhc/web/wiklou.git] / tests / phpunit / includes / json / FormatJsonTest.php
index 2760cb9..a6adf34 100644 (file)
@@ -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',