Merge "Support multi-content diffs on Special:Undelete"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / format / ApiFormatNoneTest.php
1 <?php
2
3 /**
4 * @group API
5 * @covers ApiFormatNone
6 */
7 class ApiFormatNoneTest extends ApiFormatTestBase {
8
9 protected $printerName = 'none';
10
11 public static function provideGeneralEncoding() {
12 return [
13 // Basic types
14 [ [ null ], '' ],
15 [ [ true ], '' ],
16 [ [ false ], '' ],
17 [ [ 42 ], '' ],
18 [ [ 42.5 ], '' ],
19 [ [ 1e42 ], '' ],
20 [ [ 'foo' ], '' ],
21 [ [ 'fóo' ], '' ],
22
23 // Arrays and objects
24 [ [ [] ], '' ],
25 [ [ [ 1 ] ], '' ],
26 [ [ [ 'x' => 1 ] ], '' ],
27 [ [ [ 2 => 1 ] ], '' ],
28 [ [ (object)[] ], '' ],
29 [ [ [ 1, ApiResult::META_TYPE => 'assoc' ] ], '' ],
30 [ [ [ 'x' => 1, ApiResult::META_TYPE => 'array' ] ], '' ],
31 [ [ [ 'x' => 1, ApiResult::META_TYPE => 'kvp' ] ], '' ],
32 [
33 [ [
34 'x' => 1,
35 ApiResult::META_TYPE => 'BCkvp',
36 ApiResult::META_KVP_KEY_NAME => 'key'
37 ] ],
38 ''
39 ],
40 [ [ [ 'x' => 1, ApiResult::META_TYPE => 'BCarray' ] ], '' ],
41 [ [ [ 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ] ], '' ],
42
43 // Content
44 [ [ '*' => 'foo' ], '' ],
45
46 // BC Subelements
47 [ [ 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => [ 'foo' ] ], '' ],
48 ];
49 }
50
51 }