From a55b0abef369bb874bd8b46e85e4694ab2f38303 Mon Sep 17 00:00:00 2001 From: Cameron Porter Date: Mon, 2 Mar 2020 22:11:55 -0600 Subject: [PATCH] oci8: Fix two tests that fail with stricter internal checks Closes GH-5230 --- ext/oci8/tests/array_bind_009.phpt | 10 +++++----- ext/oci8/tests/array_bind_013.phpt | 10 +++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ext/oci8/tests/array_bind_009.phpt b/ext/oci8/tests/array_bind_009.phpt index b00efc0c24..b1edfa8474 100644 --- a/ext/oci8/tests/array_bind_009.phpt +++ b/ext/oci8/tests/array_bind_009.phpt @@ -8,10 +8,10 @@ oci_bind_array_by_name() and invalid values 9 require __DIR__.'/connect.inc'; var_dump(oci_bind_array_by_name($c, ":c1", $array, 5, 5, SQLT_CHR)); - -echo "Done\n"; ?> --EXPECTF-- -Warning: oci_bind_array_by_name(): supplied resource is not a valid oci8 statement resource in %s on line %d -bool(false) -Done +Fatal error: Uncaught TypeError: oci_bind_array_by_name(): supplied resource is not a valid oci8 statement resource in %s:%d +Stack trace: +#0 %s: oci_bind_array_by_name(%s) +#1 {main} + thrown in %s on line %d \ No newline at end of file diff --git a/ext/oci8/tests/array_bind_013.phpt b/ext/oci8/tests/array_bind_013.phpt index 0d9ddabc15..a04bccf304 100644 --- a/ext/oci8/tests/array_bind_013.phpt +++ b/ext/oci8/tests/array_bind_013.phpt @@ -11,7 +11,12 @@ $statement = oci_parse($c, 'SELECT user FROM v$session'); $array = array(); -var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, -10, SQLT_CHR, -10)); +try { + var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, -10, SQLT_CHR, -10)); +} catch (ArgumentCountError $exception) { + echo $exception->getMessage() . "\n"; +} + var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, -10)); var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, -1)); var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, 0)); @@ -23,8 +28,7 @@ var_dump($array); echo "Done\n"; ?> --EXPECTF-- -Warning: oci_bind_array_by_name() expects at most 6 parameters, 7 given in %s on line %d -NULL +oci_bind_array_by_name() expects at most 6 parameters, 7 given Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d bool(false) -- 2.40.0