diff --git a/test/functional/pdo_sqlsrv/PDO94_Extend1.phpt b/test/functional/pdo_sqlsrv/PDO94_Extend1.phpt index 9aa66e36..3920d93c 100644 --- a/test/functional/pdo_sqlsrv/PDO94_Extend1.phpt +++ b/test/functional/pdo_sqlsrv/PDO94_Extend1.phpt @@ -58,7 +58,7 @@ class ExPDO extends PDO $this->test2 = 22; } - function query($sql) + function query($sql, $fetch_style = PDO::FETCH_BOTH,...$fetch_mode_args) { echo __METHOD__ . "()\n"; $stmt = parent::prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('ExPDOStatement'))); diff --git a/test/functional/pdo_sqlsrv/PDO95_Extend2.phpt b/test/functional/pdo_sqlsrv/PDO95_Extend2.phpt index 34b57307..f387be22 100644 --- a/test/functional/pdo_sqlsrv/PDO95_Extend2.phpt +++ b/test/functional/pdo_sqlsrv/PDO95_Extend2.phpt @@ -55,7 +55,7 @@ class ExPDO extends PDO return (call_user_func_array(array($this, 'parent::exec'), $args)); } - public function query(string $statement) + public function query($statement, $fetch_style = PDO::FETCH_BOTH,...$fetch_mode_args) { $this->protocol(); $args = func_get_args(); diff --git a/test/functional/pdo_sqlsrv/PDO96_Extend3.phpt b/test/functional/pdo_sqlsrv/PDO96_Extend3.phpt index bc634d16..1a80cc6f 100644 --- a/test/functional/pdo_sqlsrv/PDO96_Extend3.phpt +++ b/test/functional/pdo_sqlsrv/PDO96_Extend3.phpt @@ -61,7 +61,7 @@ class ExPDO extends PDO echo __METHOD__ . "()\n"; } - function query($sql) + function query($sql, $fetch_style = PDO::FETCH_BOTH,...$fetch_mode_args) { echo __METHOD__ . "()\n"; $stmt = $this->prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('ExPDOStatement', array($this)))); diff --git a/test/functional/pdo_sqlsrv/PDO97_Extend4.phpt b/test/functional/pdo_sqlsrv/PDO97_Extend4.phpt index e4fe031a..03f31288 100644 --- a/test/functional/pdo_sqlsrv/PDO97_Extend4.phpt +++ b/test/functional/pdo_sqlsrv/PDO97_Extend4.phpt @@ -66,7 +66,7 @@ class ExPDO extends PDO echo __METHOD__ . "()\n"; } - function query($sql) + function query($sql, $fetch_style = PDO::FETCH_BOTH,...$fetch_mode_args) { echo __METHOD__ . "()\n"; $stmt = $this->prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('ExPDOStatement', array($this)))); diff --git a/test/functional/pdo_sqlsrv/PDO98_Extend5.phpt b/test/functional/pdo_sqlsrv/PDO98_Extend5.phpt index 6cccf924..a3e9c94b 100644 --- a/test/functional/pdo_sqlsrv/PDO98_Extend5.phpt +++ b/test/functional/pdo_sqlsrv/PDO98_Extend5.phpt @@ -69,7 +69,7 @@ class ExPDO extends PDO echo __METHOD__ . "()\n"; } - function query($sql) + function query($sql, $fetch_style = PDO::FETCH_BOTH,...$fetch_mode_args) { echo __METHOD__ . "()\n"; $stmt = parent::query($sql); diff --git a/test/functional/pdo_sqlsrv/pdostatement_fetchAll.phpt b/test/functional/pdo_sqlsrv/pdostatement_fetchAll.phpt index 2bbd79eb..79b31cd2 100644 --- a/test/functional/pdo_sqlsrv/pdostatement_fetchAll.phpt +++ b/test/functional/pdo_sqlsrv/pdostatement_fetchAll.phpt @@ -80,8 +80,11 @@ function fetchAllInvalid($conn, $tbname) } catch (PDOException $ex) { print_r($ex); } catch (Error $err) { - $expected = (PHP_MAJOR_VERSION == 8) ? 'PDO::FETCH_UNKNOWN' : 'FETCH_UNKNOWN'; - $message = "Undefined class constant '$expected'"; + if (PHP_MAJOR_VERSION == 8) { + $message = "Undefined constant PDO::FETCH_UNKNOWN"; + } else { + $message = "Undefined class constant 'FETCH_UNKNOWN'"; + } if ($err->getMessage() !== $message) { echo $err->getMessage() . PHP_EOL; } diff --git a/test/functional/pdo_sqlsrv/pdostatement_fetch_style.phpt b/test/functional/pdo_sqlsrv/pdostatement_fetch_style.phpt index 4221ad0a..b03ee415 100644 --- a/test/functional/pdo_sqlsrv/pdostatement_fetch_style.phpt +++ b/test/functional/pdo_sqlsrv/pdostatement_fetch_style.phpt @@ -82,8 +82,11 @@ function fetchWithStyle($conn, $tbname, $style) } catch (PDOException $err) { print_r($err); } catch (Error $err) { - $expected = (PHP_MAJOR_VERSION == 8) ? 'PDO::FETCH_UNKNOWN' : 'FETCH_UNKNOWN'; - $message = "Undefined class constant '$expected'"; + if (PHP_MAJOR_VERSION == 8) { + $message = "Undefined constant PDO::FETCH_UNKNOWN"; + } else { + $message = "Undefined class constant 'FETCH_UNKNOWN'"; + } if ($err->getMessage() !== $message) { echo $err->getMessage() . PHP_EOL; } diff --git a/test/functional/sqlsrv/sqlsrv_input_param_unknown_encoding.phpt b/test/functional/sqlsrv/sqlsrv_input_param_unknown_encoding.phpt index 97096251..7a61e7e7 100644 --- a/test/functional/sqlsrv/sqlsrv_input_param_unknown_encoding.phpt +++ b/test/functional/sqlsrv/sqlsrv_input_param_unknown_encoding.phpt @@ -21,7 +21,7 @@ function warningHandler($errno, $errstr) function compareMessages($err) { - $exp8x = "Undefined constant 'SQLSRV_ENC_UNKNOWN'"; + $exp8x = 'Undefined constant "SQLSRV_ENC_UNKNOWN"'; $exp7x = "Use of undefined constant SQLSRV_ENC_UNKNOWN - assumed 'SQLSRV_ENC_UNKNOWN' (this will throw an Error in a future version of PHP)"; $expected = (PHP_MAJOR_VERSION == 8) ? $exp8x : $exp7x;