summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/array_diff_assoc_variation2.phpt
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-05-31 10:35:07 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-05-31 10:52:06 +0200
commit4e391ee3a3086d4072012d5ed782517ed41ed400 (patch)
treedabe43dc2f97e047e0ef801fe066fea75dc8376e /ext/standard/tests/array/array_diff_assoc_variation2.phpt
parent4fff40e0d249423be5fe51aeedb0a23911f55bd2 (diff)
downloadphp-git-4e391ee3a3086d4072012d5ed782517ed41ed400.tar.gz
Convert some warnings to TypeErrors in array functions
This is manual type and argument number checking code that was not covered by the zpp move to TypeErrors.
Diffstat (limited to 'ext/standard/tests/array/array_diff_assoc_variation2.phpt')
-rw-r--r--ext/standard/tests/array/array_diff_assoc_variation2.phpt116
1 files changed, 34 insertions, 82 deletions
diff --git a/ext/standard/tests/array/array_diff_assoc_variation2.phpt b/ext/standard/tests/array/array_diff_assoc_variation2.phpt
index a57f10fce0..9185b53439 100644
--- a/ext/standard/tests/array/array_diff_assoc_variation2.phpt
+++ b/ext/standard/tests/array/array_diff_assoc_variation2.phpt
@@ -91,143 +91,95 @@ $inputs = array(
// loop through each element of $inputs to check the behavior of array_diff_assoc
$iterator = 1;
foreach($inputs as $input) {
- echo "\n-- Iteration $iterator --\n";
- var_dump( array_diff_assoc($array, $input));
- $iterator++;
+ echo "\n-- Iteration $iterator --\n";
+ try {
+ var_dump(array_diff_assoc($array, $input));
+ } catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+ }
+ $iterator++;
};
fclose($fp);
echo "Done";
?>
---EXPECTF--
+--EXPECT--
*** Testing array_diff_assoc() : usage variations ***
-- Iteration 1 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, int given in %s on line %d
-NULL
+Expected parameter 2 to be an array, int given
-- Iteration 2 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, int given in %s on line %d
-NULL
+Expected parameter 2 to be an array, int given
-- Iteration 3 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, int given in %s on line %d
-NULL
+Expected parameter 2 to be an array, int given
-- Iteration 4 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, int given in %s on line %d
-NULL
+Expected parameter 2 to be an array, int given
-- Iteration 5 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, float given in %s on line %d
-NULL
+Expected parameter 2 to be an array, float given
-- Iteration 6 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, float given in %s on line %d
-NULL
+Expected parameter 2 to be an array, float given
-- Iteration 7 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, float given in %s on line %d
-NULL
+Expected parameter 2 to be an array, float given
-- Iteration 8 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, float given in %s on line %d
-NULL
+Expected parameter 2 to be an array, float given
-- Iteration 9 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, float given in %s on line %d
-NULL
+Expected parameter 2 to be an array, float given
-- Iteration 10 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, null given in %s on line %d
-NULL
+Expected parameter 2 to be an array, null given
-- Iteration 11 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, null given in %s on line %d
-NULL
+Expected parameter 2 to be an array, null given
-- Iteration 12 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, bool given in %s on line %d
-NULL
+Expected parameter 2 to be an array, bool given
-- Iteration 13 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, bool given in %s on line %d
-NULL
+Expected parameter 2 to be an array, bool given
-- Iteration 14 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, bool given in %s on line %d
-NULL
+Expected parameter 2 to be an array, bool given
-- Iteration 15 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, bool given in %s on line %d
-NULL
+Expected parameter 2 to be an array, bool given
-- Iteration 16 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, string given in %s on line %d
-NULL
+Expected parameter 2 to be an array, string given
-- Iteration 17 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, string given in %s on line %d
-NULL
+Expected parameter 2 to be an array, string given
-- Iteration 18 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, string given in %s on line %d
-NULL
+Expected parameter 2 to be an array, string given
-- Iteration 19 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, string given in %s on line %d
-NULL
+Expected parameter 2 to be an array, string given
-- Iteration 20 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, string given in %s on line %d
-NULL
+Expected parameter 2 to be an array, string given
-- Iteration 21 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, string given in %s on line %d
-NULL
+Expected parameter 2 to be an array, string given
-- Iteration 22 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, string given in %s on line %d
-NULL
+Expected parameter 2 to be an array, string given
-- Iteration 23 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, object given in %s on line %d
-NULL
+Expected parameter 2 to be an array, object given
-- Iteration 24 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, null given in %s on line %d
-NULL
+Expected parameter 2 to be an array, null given
-- Iteration 25 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, null given in %s on line %d
-NULL
+Expected parameter 2 to be an array, null given
-- Iteration 26 --
-
-Warning: array_diff_assoc(): Expected parameter 2 to be an array, resource given in %s on line %d
-NULL
+Expected parameter 2 to be an array, resource given
Done