projects
/
m6w6
/
ext-json_post
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (from parent 1:
d4d2ec5
)
PHP compat 5-8
author
Michael Wallner
<mike@php.net>
Fri, 17 Sep 2021 12:18:54 +0000
(14:18 +0200)
committer
Michael Wallner
<mike@php.net>
Fri, 17 Sep 2021 12:18:54 +0000
(14:18 +0200)
tests/error.inc
patch
|
blob
|
history
tests/error001.phpt
patch
|
blob
|
history
tests/error002.phpt
patch
|
blob
|
history
tests/error003.phpt
patch
|
blob
|
history
tests/error004.phpt
patch
|
blob
|
history
tests/error005.phpt
patch
|
blob
|
history
tests/error006.phpt
patch
|
blob
|
history
diff --git
a/tests/error.inc
b/tests/error.inc
index bc957d75c20a81c577383c78822dc2fddd1bdd3e..16ae31d41295ba7a36e976813723db293c96ff82 100644
(file)
--- a/
tests/error.inc
+++ b/
tests/error.inc
@@
-1,9
+1,9
@@
<?php
if ($_POST)
var_dump(compact("_POST"));
<?php
if ($_POST)
var_dump(compact("_POST"));
-if (($json_last_error = json_last_error()))
+if (
PHP_VERSION_ID >= 70000 &&
($json_last_error = json_last_error()))
var_dump(compact("json_last_error"));
var_dump(compact("json_last_error"));
-if (($JSON_POST_ERROR = JSON_POST_ERROR) !==
3
)
+if (($JSON_POST_ERROR = JSON_POST_ERROR) !==
(PHP_VERSION_ID < 70000 ? 4 : 3)
)
var_dump(compact("JSON_POST_ERROR"));
if (($http_response_code = http_response_code()) != ini_get("json_post.onerror.response") && ini_get("json_post.onerror.response"))
var_dump(compact("http_response_code"));
var_dump(compact("JSON_POST_ERROR"));
if (($http_response_code = http_response_code()) != ini_get("json_post.onerror.response") && ini_get("json_post.onerror.response"))
var_dump(compact("http_response_code"));
diff --git
a/tests/error001.phpt
b/tests/error001.phpt
index ea4d193f870910c9c54b1ace9215dbf5c92c5fee..58d957bceec6fc02615b9a007fa963c3d1533976 100644
(file)
--- a/
tests/error001.phpt
+++ b/
tests/error001.phpt
@@
-1,7
+1,5
@@
--TEST--
json_post with malformed JSON [default] (https://github.com/m6w6/ext-json_post/issues/3)
--TEST--
json_post with malformed JSON [default] (https://github.com/m6w6/ext-json_post/issues/3)
---EXTENSIONS--
-json_post
--POST_RAW--
Content-Type: application/json
--POST_RAW--
Content-Type: application/json
diff --git
a/tests/error002.phpt
b/tests/error002.phpt
index c4d35110b32c7899d72e3f251dd849131ad37739..076d2a71edefcf435eb1f520323981e8f3f9b274 100644
(file)
--- a/
tests/error002.phpt
+++ b/
tests/error002.phpt
@@
-1,7
+1,5
@@
--TEST--
json_post with malformed JSON [response] (https://github.com/m6w6/ext-json_post/issues/3)
--TEST--
json_post with malformed JSON [response] (https://github.com/m6w6/ext-json_post/issues/3)
---EXTENSIONS--
-json_post
--INI--
json_post.onerror.response = 400
--POST_RAW--
--INI--
json_post.onerror.response = 400
--POST_RAW--
diff --git
a/tests/error003.phpt
b/tests/error003.phpt
index 93bcc9ba6bc05653a7b56ca58cbeb31e71deb180..dd7a3e5b676df1002123d422c3c030d5215c5522 100644
(file)
--- a/
tests/error003.phpt
+++ b/
tests/error003.phpt
@@
-1,7
+1,5
@@
--TEST--
json_post with malformed JSON [warning] (https://github.com/m6w6/ext-json_post/issues/3)
--TEST--
json_post with malformed JSON [warning] (https://github.com/m6w6/ext-json_post/issues/3)
---EXTENSIONS--
-json_post
--INI--
json_post.onerror.warning = on
--POST_RAW--
--INI--
json_post.onerror.warning = on
--POST_RAW--
@@
-12,5
+10,5
@@
Content-Type: application/json
error.inc
--EXPECTHEADERS--
--EXPECTF--
error.inc
--EXPECTHEADERS--
--EXPECTF--
-Warning: json_post: json_decode failed with error code:
3
in %s on line %s
+Warning: json_post: json_decode failed with error code:
%d
in %s on line %s
DONE
DONE
diff --git
a/tests/error004.phpt
b/tests/error004.phpt
index 00fb76b9113db79ee2acf603373da946164f5a5d..e450593328fba0011ac2c1770fc984a2550d50cf 100644
(file)
--- a/
tests/error004.phpt
+++ b/
tests/error004.phpt
@@
-1,7
+1,5
@@
--TEST--
json_post with malformed JSON [exit] (https://github.com/m6w6/ext-json_post/issues/3)
--TEST--
json_post with malformed JSON [exit] (https://github.com/m6w6/ext-json_post/issues/3)
---EXTENSIONS--
-json_post
--INI--
json_post.onerror.exit = true
--POST_RAW--
--INI--
json_post.onerror.exit = true
--POST_RAW--
diff --git
a/tests/error005.phpt
b/tests/error005.phpt
index 97c4988d0601a280dc808b9a4511f769f7a39bce..3ebabd8b4445513b8abf40e3e5c568f610140e9a 100644
(file)
--- a/
tests/error005.phpt
+++ b/
tests/error005.phpt
@@
-1,7
+1,5
@@
--TEST--
json_post with malformed JSON [response override] (https://github.com/m6w6/ext-json_post/issues/3)
--TEST--
json_post with malformed JSON [response override] (https://github.com/m6w6/ext-json_post/issues/3)
---EXTENSIONS--
-json_post
--INI--
json_post.onerror.response = 444
--POST_RAW--
--INI--
json_post.onerror.response = 444
--POST_RAW--
diff --git
a/tests/error006.phpt
b/tests/error006.phpt
index aef634ab828c4e8b0769fec2a0bdf70fd7b6d5e3..afc1c8765529bd6a0664f3deb21cbe639ab83d05 100644
(file)
--- a/
tests/error006.phpt
+++ b/
tests/error006.phpt
@@
-1,7
+1,5
@@
--TEST--
json_post with malformed JSON [json_throw] (https://github.com/m6w6/ext-json_post/issues/3)
--TEST--
json_post with malformed JSON [json_throw] (https://github.com/m6w6/ext-json_post/issues/3)
---EXTENSIONS--
-json_post
--INI--
json_post.flags = 4194305
--POST_RAW--
--INI--
json_post.flags = 4194305
--POST_RAW--