643f56098491b11041169d4ad248cfba7007c54f
[m6w6/ext-json_post] / tests / 002.phpt
1 --TEST--
2 json_post
3 --SKIPIF--
4 <?php
5 extension_loaded("json_post")) or die("skip need json_post support\n");
6 ?>
7 --INI--
8 json_post.flags=2;JSON_BIGINT_AS_STRING
9 --POST_RAW--
10 Content-type: text/json
11
12 {
13 "null": null,
14 "bool": true,
15 "int": 123,
16 "bigint": 36893488147419103232,
17 "float": 123.123,
18 "string": "Hello World",
19 "array": [1,2,3],
20 "object": {
21 "array": [1,2,3],
22 "unicode": "\u00D6sterreich"
23 }
24 }
25 --FILE--
26 <?php
27 var_dump($_POST, json_last_error_msg());
28 ?>
29 --EXPECTF--
30 object(stdClass)#%d (8) {
31 ["null"]=>
32 NULL
33 ["bool"]=>
34 bool(true)
35 ["int"]=>
36 int(123)
37 ["bigint"]=>
38 string(20) "36893488147419103232"
39 ["float"]=>
40 float(123.123)
41 ["string"]=>
42 string(11) "Hello World"
43 ["array"]=>
44 array(3) {
45 [0]=>
46 int(1)
47 [1]=>
48 int(2)
49 [2]=>
50 int(3)
51 }
52 ["object"]=>
53 object(stdClass)#%d (2) {
54 ["array"]=>
55 array(3) {
56 [0]=>
57 int(1)
58 [1]=>
59 int(2)
60 [2]=>
61 int(3)
62 }
63 ["unicode"]=>
64 string(11) "Österreich"
65 }
66 }
67 string(8) "No error"