Index: trunk/phase3/tests/phpunit/includes/json/ServicesJsonTest.php |
— | — | @@ -54,18 +54,40 @@ |
55 | 55 | $obj->property3 = 1.234; |
56 | 56 | return array( |
57 | 57 | array( 1, 'basic integer' ), |
| 58 | + array( -1, 'negative integer' ), |
| 59 | + array( 1.1, 'basic float' ), |
58 | 60 | array( true, 'basic bool true' ), |
59 | 61 | array( false, 'basic bool false' ), |
60 | 62 | array( 'some string', 'basic string test' ), |
| 63 | + array( "some string\nwith newline", 'newline string test' ), |
| 64 | + array( '♥ü', 'unicode string test' ), |
61 | 65 | array( array( 'some', 'string', 'values' ), 'basic array of strings' ), |
62 | 66 | array( array( 'key1' => 'val1', 'key2' => 'val2' ), 'array with string keys' ), |
| 67 | + array( array( 1 => 'val1', 3 => 'val2', '2' => 'val3' ), 'out of order numbered array test' ), |
| 68 | + array( array(), 'empty array test' ), |
63 | 69 | array( $obj, 'basic object test' ), |
| 70 | + array( new stdClass, 'empty object test' ), |
| 71 | + array( null, 'null test' ), |
64 | 72 | ); |
65 | 73 | } |
66 | 74 | |
67 | 75 | function provideValuesToDecode() { |
68 | 76 | return array( |
| 77 | + array( '1', 'basic integer' ), |
| 78 | + array( '-1', 'negative integer' ), |
| 79 | + array( '1.1', 'basic float' ), |
| 80 | + array( '1.1e1', 'scientific float' ), |
| 81 | + array( 'true', 'basic bool true' ), |
| 82 | + array( 'false', 'basic bool false' ), |
| 83 | + array( '"some string"', 'basic string test' ), |
| 84 | + array( '"some string\nwith newline"', 'newline string test' ), |
| 85 | + array( '"♥ü"', 'unicode character string test' ), |
| 86 | + array( '"\u2665"', 'unicode \\u string test' ), |
| 87 | + array( '["some","string","values"]', 'basic array of strings' ), |
| 88 | + array( '[]', 'empty array test' ), |
69 | 89 | array( '{"key":"value"}', 'Basic key => value test' ), |
| 90 | + array( '{}', 'empty object test' ), |
| 91 | + array( 'null', 'null test' ), |
70 | 92 | ); |
71 | 93 | } |
72 | 94 | } |