Merge "Fix behaviour of namespaceSelector to match the documentation"
[lhc/web/wiklou.git] / tests / phpunit / includes / JsonTest.php
1 <?php
2
3 class JsonTest extends MediaWikiTestCase {
4
5 function testPhpBug46944Test() {
6
7 $this->assertNotEquals(
8 '\ud840\udc00',
9 strtolower( FormatJson::encode( "\xf0\xa0\x80\x80" ) ),
10 'Test encoding an broken json_encode character (U+20000)'
11 );
12
13
14 }
15
16 function testDecodeVarTypes() {
17
18 $this->assertInternalType(
19 'object',
20 FormatJson::decode( '{"Name": "Cheeso", "Rank": 7}' ),
21 'Default to object'
22 );
23
24 $this->assertInternalType(
25 'array',
26 FormatJson::decode( '{"Name": "Cheeso", "Rank": 7}', true ),
27 'Optional array'
28 );
29
30 }
31
32 }
33