Import: Handle uploads with sha1 starting with 0 properly
[mediawiki.git] / tests / phpunit / includes / api / format / ApiFormatNoneTest.php
blobc0192bc3fb7908f84c12a87c65a81d08e75f9230
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 array(
13 // Basic types
14 array( array( null ), '' ),
15 array( array( true ), '' ),
16 array( array( false ), '' ),
17 array( array( 42 ), '' ),
18 array( array( 42.5 ), '' ),
19 array( array( 1e42 ), '' ),
20 array( array( 'foo' ), '' ),
21 array( array( 'fóo' ), '' ),
23 // Arrays and objects
24 array( array( array() ), '' ),
25 array( array( array( 1 ) ), '' ),
26 array( array( array( 'x' => 1 ) ), '' ),
27 array( array( array( 2 => 1 ) ), '' ),
28 array( array( (object)array() ), '' ),
29 array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), '' ),
30 array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), '' ),
31 array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), '' ),
32 array(
33 array( array(
34 'x' => 1,
35 ApiResult::META_TYPE => 'BCkvp',
36 ApiResult::META_KVP_KEY_NAME => 'key'
37 ) ),
40 array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), '' ),
41 array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), '' ),
43 // Content
44 array( array( '*' => 'foo' ), '' ),
46 // BC Subelements
47 array( array( 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => array( 'foo' ) ), '' ),