Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: I48014b6464f3e7e2b7f083e67f517af0b1a9367e
56 lines
1.2 KiB
PHP
56 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Tests\Api\Format;
|
|
|
|
use ApiResult;
|
|
|
|
/**
|
|
* @group API
|
|
* @covers \ApiFormatNone
|
|
*/
|
|
class ApiFormatNoneTest extends ApiFormatTestBase {
|
|
|
|
/** @inheritDoc */
|
|
protected $printerName = 'none';
|
|
|
|
public static function provideGeneralEncoding() {
|
|
return [
|
|
// Basic types
|
|
[ [ null ], '' ],
|
|
[ [ true ], '' ],
|
|
[ [ false ], '' ],
|
|
[ [ 42 ], '' ],
|
|
[ [ 42.5 ], '' ],
|
|
[ [ 1e42 ], '' ],
|
|
[ [ 'foo' ], '' ],
|
|
[ [ 'fóo' ], '' ],
|
|
|
|
// Arrays and objects
|
|
[ [ [] ], '' ],
|
|
[ [ [ 1 ] ], '' ],
|
|
[ [ [ 'x' => 1 ] ], '' ],
|
|
[ [ [ 2 => 1 ] ], '' ],
|
|
[ [ (object)[] ], '' ],
|
|
[ [ [ 1, ApiResult::META_TYPE => 'assoc' ] ], '' ],
|
|
[ [ [ 'x' => 1, ApiResult::META_TYPE => 'array' ] ], '' ],
|
|
[ [ [ 'x' => 1, ApiResult::META_TYPE => 'kvp' ] ], '' ],
|
|
[
|
|
[ [
|
|
'x' => 1,
|
|
ApiResult::META_TYPE => 'BCkvp',
|
|
ApiResult::META_KVP_KEY_NAME => 'key'
|
|
] ],
|
|
''
|
|
],
|
|
[ [ [ 'x' => 1, ApiResult::META_TYPE => 'BCarray' ] ], '' ],
|
|
[ [ [ 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ] ], '' ],
|
|
|
|
// Content
|
|
[ [ '*' => 'foo' ], '' ],
|
|
|
|
// BC Subelements
|
|
[ [ 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => [ 'foo' ] ], '' ],
|
|
];
|
|
}
|
|
|
|
}
|