| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Tests\Api\Format; |
| 4 |
|
| 5 |
use MediaWiki\Api\ApiResult; |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
class ApiFormatNoneTest extends ApiFormatTestBase { |
| 12 |
|
| 13 |
|
| 14 |
protected $printerName = 'none'; |
| 15 |
|
| 16 |
public static function provideGeneralEncoding() { |
| 17 |
return [ |
| 18 |
|
| 19 |
[ [ null ], '' ], |
| 20 |
[ [ true ], '' ], |
| 21 |
[ [ false ], '' ], |
| 22 |
[ [ 42 ], '' ], |
| 23 |
[ [ 42.5 ], '' ], |
| 24 |
[ [ 1e42 ], '' ], |
| 25 |
[ [ 'foo' ], '' ], |
| 26 |
[ [ 'fóo' ], '' ], |
| 27 |
|
| 28 |
|
| 29 |
[ [ [] ], '' ], |
| 30 |
[ [ [ 1 ] ], '' ], |
| 31 |
[ [ [ 'x' => 1 ] ], '' ], |
| 32 |
[ [ [ 2 => 1 ] ], '' ], |
| 33 |
[ [ (object)[] ], '' ], |
| 34 |
[ [ [ 1, ApiResult::META_TYPE => 'assoc' ] ], '' ], |
| 35 |
[ [ [ 'x' => 1, ApiResult::META_TYPE => 'array' ] ], '' ], |
| 36 |
[ [ [ 'x' => 1, ApiResult::META_TYPE => 'kvp' ] ], '' ], |
| 37 |
[ |
| 38 |
[ [ |
| 39 |
'x' => 1, |
| 40 |
ApiResult::META_TYPE => 'BCkvp', |
| 41 |
ApiResult::META_KVP_KEY_NAME => 'key' |
| 42 |
] ], |
| 43 |
'' |
| 44 |
], |
| 45 |
[ [ [ 'x' => 1, ApiResult::META_TYPE => 'BCarray' ] ], '' ], |
| 46 |
[ [ [ 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ] ], '' ], |
| 47 |
|
| 48 |
|
| 49 |
[ [ '*' => 'foo' ], '' ], |
| 50 |
|
| 51 |
|
| 52 |
[ [ 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => [ 'foo' ] ], '' ], |
| 53 |
]; |
| 54 |
} |
| 55 |
|
| 56 |
} |