From 91e194556c52d2f354344f930419eef2dd6267f0 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 4 Sep 2013 05:51:59 +0200 Subject: Update to MediaWiki 1.21.2 --- tests/phpunit/includes/JsonTest.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/phpunit/includes/JsonTest.php (limited to 'tests/phpunit/includes/JsonTest.php') diff --git a/tests/phpunit/includes/JsonTest.php b/tests/phpunit/includes/JsonTest.php new file mode 100644 index 00000000..96a2ead5 --- /dev/null +++ b/tests/phpunit/includes/JsonTest.php @@ -0,0 +1,27 @@ +assertNotEquals( + '\ud840\udc00', + strtolower( FormatJson::encode( "\xf0\xa0\x80\x80" ) ), + 'Test encoding an broken json_encode character (U+20000)' + ); + + } + + function testDecodeVarTypes() { + $this->assertInternalType( + 'object', + FormatJson::decode( '{"Name": "Cheeso", "Rank": 7}' ), + 'Default to object' + ); + + $this->assertInternalType( + 'array', + FormatJson::decode( '{"Name": "Cheeso", "Rank": 7}', true ), + 'Optional array' + ); + } +} -- cgit v1.2.3-54-g00ecf