Merge "Merge namespace aliases like we merge namespace names"
[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 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' ), '' ),
22
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 ) ),
38 ''
39 ),
40 array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), '' ),
41 array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), '' ),
42
43 // Content
44 array( array( '*' => 'foo' ), '' ),
45
46 // BC Subelements
47 array( array( 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => array( 'foo' ) ), '' ),
48 );
49 }
50
51 }