projects
/
m6w6
/
ext-json_post
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
JSON_POST_ERROR, json_post.onerror.* INI, warning
[m6w6/ext-json_post]
/
tests
/
error003.phpt
diff --git
a/tests/error003.phpt
b/tests/error003.phpt
index 9147a12855e619399ef56e05ac6f61c31a8e7a80..93bcc9ba6bc05653a7b56ca58cbeb31e71deb180 100644
(file)
--- a/
tests/error003.phpt
+++ b/
tests/error003.phpt
@@
-1,25
+1,16
@@
--TEST--
--TEST--
-json_post with malformed JSON (https://github.com/m6w6/ext-json_post/issues/3)
---SKIPIF--
-<?php
-extension_loaded("json_post") or die("skip need json_post support\n");
-?>
+json_post with malformed JSON [warning] (https://github.com/m6w6/ext-json_post/issues/3)
+--EXTENSIONS--
+json_post
--INI--
--INI--
-json_post.error_response = 444
-json_post.error_exit = true
+json_post.onerror.warning = on
--POST_RAW--
Content-Type: application/json
--POST_RAW--
Content-Type: application/json
-{
- "greeting": "Hello World
-}
---FILE--
-<?php
-var_dump($_POST);
-var_dump(http_response_code());
-?>
-Done
+{"a
+--FILE_EXTERNAL--
+error.inc
--EXPECTHEADERS--
--EXPECTHEADERS--
-Status: 444
-X-JSON-Error-Code: 3
---EXPECT--
+--EXPECTF--
+Warning: json_post: json_decode failed with error code: 3 in %s on line %s
+DONE