fix ws
[m6w6/ext-json_post] / tests / error001.phpt
1 --TEST--
2 json_post with malformed JSON (https://github.com/m6w6/ext-json_post/issues/3)
3 --SKIPIF--
4 <?php
5 extension_loaded("json_post") or die("skip need json_post support\n");
6 ?>
7 --INI--
8 json_post.error_response = 400
9 --POST_RAW--
10 Content-Type: application/json
11
12 {
13 "greeting": "Hello World
14 }
15 --FILE--
16 <?php
17 var_dump($_POST);
18 var_dump(json_last_error());
19 ?>
20 Done
21 --EXPECTHEADERS--
22 Status: 400 Bad Request
23 X-JSON-Error-Code: 3
24 --EXPECTF--
25 array(0) {
26 }
27 int(0)
28 Done