diff options
Diffstat (limited to 'ext/mysqli/tests/mysqli_fetch_object.phpt')
| -rw-r--r-- | ext/mysqli/tests/mysqli_fetch_object.phpt | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/ext/mysqli/tests/mysqli_fetch_object.phpt b/ext/mysqli/tests/mysqli_fetch_object.phpt index 9706ceac84..dff91531ce 100644 --- a/ext/mysqli/tests/mysqli_fetch_object.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object.phpt @@ -59,18 +59,25 @@ require_once('skipifconnectfailure.inc'); } - $obj = mysqli_fetch_object($res, 'mysqli_fetch_object_construct', array()); - - if (($obj->ID !== "3") || ($obj->label !== "c") || ($obj->a !== NULL) || ($obj->b !== NULL) || (get_class($obj) != 'mysqli_fetch_object_construct')) { - printf("[006] Object seems wrong. [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - var_dump($obj); - } + try { + $obj = mysqli_fetch_object($res, 'mysqli_fetch_object_construct', array()); + if (($obj->ID !== "3") || ($obj->label !== "c") || ($obj->a !== NULL) || ($obj->b !== NULL) || (get_class($obj) != 'mysqli_fetch_object_construct')) { + printf("[006] Object seems wrong. [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + var_dump($obj); + } + } catch (Throwable $e) { + echo "Exception: " . $e->getMessage() . "\n"; + } - $obj = mysqli_fetch_object($res, 'mysqli_fetch_object_construct', array('a')); - if (($obj->ID !== "4") || ($obj->label !== "d") || ($obj->a !== 'a') || ($obj->b !== NULL) || (get_class($obj) != 'mysqli_fetch_object_construct')) { - printf("[007] Object seems wrong. [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - var_dump($obj); - } + try { + $obj = mysqli_fetch_object($res, 'mysqli_fetch_object_construct', array('a')); + if (($obj->ID !== "4") || ($obj->label !== "d") || ($obj->a !== 'a') || ($obj->b !== NULL) || (get_class($obj) != 'mysqli_fetch_object_construct')) { + printf("[007] Object seems wrong. [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + var_dump($obj); + } + } catch (Throwable $e) { + echo "Exception: " . $e->getMessage() . "\n"; + } $obj = mysqli_fetch_object($res, 'mysqli_fetch_object_construct', array('a', 'b')); if (($obj->ID !== "5") || ($obj->label !== "e") || ($obj->a !== 'a') || ($obj->b !== 'b') || (get_class($obj) != 'mysqli_fetch_object_construct')) { @@ -140,12 +147,8 @@ require_once('skipifconnectfailure.inc'); --EXPECTF-- [E_WARNING] mysqli_fetch_object() expects at least 1 parameter, 0 given in %s on line %d [E_WARNING] mysqli_fetch_object() expects parameter 1 to be mysqli_result, null given in %s on line %d -[E_WARNING] Missing argument 1 for mysqli_fetch_object_construct::__construct() in %s on line %d -[E_WARNING] Missing argument 2 for mysqli_fetch_object_construct::__construct() in %s on line %d -[E_NOTICE] Undefined variable: a in %s on line %d -[E_NOTICE] Undefined variable: b in %s on line %d -[E_WARNING] Missing argument 2 for mysqli_fetch_object_construct::__construct() in %s on line %d -[E_NOTICE] Undefined variable: b in %s on line %d +Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 0 passed and exactly 2 expected +Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected NULL NULL [E_WARNING] mysqli_fetch_object(): Couldn't fetch mysqli_result in %s on line %d |
