From bda8b43e0418324d9caf532c146bca5a5be89fc1 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 17 Sep 2021 14:18:54 +0200 Subject: [PATCH] PHP compat 5-8 --- tests/error.inc | 4 ++-- tests/error001.phpt | 2 -- tests/error002.phpt | 2 -- tests/error003.phpt | 4 +--- tests/error004.phpt | 2 -- tests/error005.phpt | 2 -- tests/error006.phpt | 2 -- 7 files changed, 3 insertions(+), 15 deletions(-) diff --git a/tests/error.inc b/tests/error.inc index bc957d7..16ae31d 100644 --- a/tests/error.inc +++ b/tests/error.inc @@ -1,9 +1,9 @@ = 70000 && ($json_last_error = 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")); diff --git a/tests/error001.phpt b/tests/error001.phpt index ea4d193..58d957b 100644 --- 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) ---EXTENSIONS-- -json_post --POST_RAW-- Content-Type: application/json diff --git a/tests/error002.phpt b/tests/error002.phpt index c4d3511..076d2a7 100644 --- 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) ---EXTENSIONS-- -json_post --INI-- json_post.onerror.response = 400 --POST_RAW-- diff --git a/tests/error003.phpt b/tests/error003.phpt index 93bcc9b..dd7a3e5 100644 --- 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) ---EXTENSIONS-- -json_post --INI-- json_post.onerror.warning = on --POST_RAW-- @@ -12,5 +10,5 @@ Content-Type: application/json 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 diff --git a/tests/error004.phpt b/tests/error004.phpt index 00fb76b..e450593 100644 --- 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) ---EXTENSIONS-- -json_post --INI-- json_post.onerror.exit = true --POST_RAW-- diff --git a/tests/error005.phpt b/tests/error005.phpt index 97c4988..3ebabd8 100644 --- 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) ---EXTENSIONS-- -json_post --INI-- json_post.onerror.response = 444 --POST_RAW-- diff --git a/tests/error006.phpt b/tests/error006.phpt index aef634a..afc1c87 100644 --- 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) ---EXTENSIONS-- -json_post --INI-- json_post.flags = 4194305 --POST_RAW-- -- 2.30.2