Merge "Revert "Revert "Show a "(blocked)" hint on Special:ListUsers/ActiveUsers"""
[lhc/web/wiklou.git] / tests / phpunit / includes / JsonTest.php
1 <?php
2
3 class JsonTest extends MediaWikiTestCase {
4
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)'
10 );
11
12 }
13
14 function testDecodeVarTypes() {
15 $this->assertInternalType(
16 'object',
17 FormatJson::decode( '{"Name": "Cheeso", "Rank": 7}' ),
18 'Default to object'
19 );
20
21 $this->assertInternalType(
22 'array',
23 FormatJson::decode( '{"Name": "Cheeso", "Rank": 7}', true ),
24 'Optional array'
25 );
26 }
27 }