Added release notes for 'ContentHandler::runLegacyHooks' removal
[mediawiki.git] / tests / phpunit / includes / api / format / ApiFormatNoneTest.php
blob87e36703c475620c285b9bf83ac582e8ffb46b41
1 <?php
3 /**
4 * @group API
5 * @covers ApiFormatNone
6 */
7 class ApiFormatNoneTest extends ApiFormatTestBase {
9 protected $printerName = 'none';
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' ], '' ],
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' ] ], '' ],
33 [ [
34 'x' => 1,
35 ApiResult::META_TYPE => 'BCkvp',
36 ApiResult::META_KVP_KEY_NAME => 'key'
37 ] ],
40 [ [ [ 'x' => 1, ApiResult::META_TYPE => 'BCarray' ] ], '' ],
41 [ [ [ 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ] ], '' ],
43 // Content
44 [ [ '*' => 'foo' ], '' ],
46 // BC Subelements
47 [ [ 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => [ 'foo' ] ], '' ],