Merge "mw.loader: Guard against odd setTimeout behaviour in old Firefox"
[mediawiki.git] / tests / phpunit / includes / JsonTest.php
blob96a2ead528aa6f7fc8a47d5bbd8a9b8ea3704904
1 <?php
3 class JsonTest extends MediaWikiTestCase {
5 function testPhpBug46944Test() {
6 $this->assertNotEquals(
7 '\ud840\udc00',
8 strtolower( FormatJson::encode( "\xf0\xa0\x80\x80" ) ),
9 'Test encoding an broken json_encode character (U+20000)'
14 function testDecodeVarTypes() {
15 $this->assertInternalType(
16 'object',
17 FormatJson::decode( '{"Name": "Cheeso", "Rank": 7}' ),
18 'Default to object'
21 $this->assertInternalType(
22 'array',
23 FormatJson::decode( '{"Name": "Cheeso", "Rank": 7}', true ),
24 'Optional array'