split off pecl_http
[m6w6/ext-json_post] / tests / 001.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 --POST_RAW--
8 Content-type: text/json
9
10 {
11 "null": null,
12 "bool": true,
13 "int": 123,
14 "bigint": 36893488147419103232,
15 "float": 123.123,
16 "string": "Hello World",
17 "array": [1,2,3],
18 "object": {
19 "array": [1,2,3],
20 "unicode": "\u00D6sterreich"
21 }
22 }
23 --FILE--
24 <?php
25 var_dump($_POST, json_last_error_msg());
26 ?>
27 --EXPECTF--
28 array(8) {
29 ["null"]=>
30 NULL
31 ["bool"]=>
32 bool(true)
33 ["int"]=>
34 int(123)
35 ["bigint"]=>
36 float(3.689%dE+19)
37 ["float"]=>
38 float(123.123)
39 ["string"]=>
40 string(11) "Hello World"
41 ["array"]=>
42 array(3) {
43 [0]=>
44 int(1)
45 [1]=>
46 int(2)
47 [2]=>
48 int(3)
49 }
50 ["object"]=>
51 array(2) {
52 ["array"]=>
53 array(3) {
54 [0]=>
55 int(1)
56 [1]=>
57 int(2)
58 [2]=>
59 int(3)
60 }
61 ["unicode"]=>
62 string(11) "Österreich"
63 }
64 }
65 string(8) "No error"