fix typo
[m6w6/ext-json_post] / tests / error002.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 if (PHP_VERSION_ID < 70000) die("skip need PHP-7.0+\n");
7 ?>
8 --INI--
9 json_post.error_response = 400
10 json_post.flags = 4194305
11 --POST_RAW--
12 Content-Type: application/json
13
14 {
15 "greeting": "Hello World
16 }
17 --FILE--
18 <?php
19 var_dump($_POST);
20 var_dump(http_response_code());
21 ?>
22 Done
23 --EXPECTHEADERS--
24 Status: 400 Bad Request
25 X-JSON-Error-Code: 3
26 --EXPECTF--
27 array(0) {
28 }
29 int(400)
30 Done