Skip to content

Commit

Permalink
Fix pdo_oci tests for PHP 8.1
Browse files Browse the repository at this point in the history
Closes GH-9051
  • Loading branch information
mvorisek authored and kocsismate committed Aug 24, 2022
1 parent 95befc7 commit 2db2cab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
14 changes: 12 additions & 2 deletions ext/pdo/tests/pdo_039.phpt
Expand Up @@ -28,19 +28,29 @@ if ($pass === false) $pass = NULL;

$conn = new PDO($dsn, $user, $pass, $attr);

$query = 'SELECT 1';
var_dump($conn->errorCode());

$query = 'SELECT 1';
if ($conn->getAttribute(PDO::ATTR_DRIVER_NAME) === 'oci') {
$query .= ' FROM DUAL';
}
var_dump($conn->errorCode());
$stmt = $conn->prepare($query);
var_dump($conn->errorCode());

$stmt = $conn->prepare($query);
var_dump($conn->errorCode());
var_dump($stmt->errorCode());

$stmt->execute();
var_dump($stmt->errorCode());
var_dump($stmt->errorCode());

?>
--EXPECT--
NULL
string(5) "00000"
string(5) "00000"
string(5) "00000"
NULL
string(5) "00000"
string(5) "00000"
11 changes: 1 addition & 10 deletions ext/pdo_oci/tests/pdo_oci_quote1.phpt
Expand Up @@ -21,7 +21,7 @@ $stmt = $db->prepare('select * from poq_tab');
// The intent is that the fetched data be identical to the unquoted string.
// Remember!: use bind variables instead of PDO->quote()

$a = array(null, "", "a", "ab", "abc", "ab'cd", "a\b\n", "'", "''", "a'", "'z", "a''b", '"');
$a = array("", "a", "ab", "abc", "ab'cd", "a\b\n", "'", "''", "a'", "'z", "a''b", '"');
foreach ($a as $u) {
$q = $db->quote($u);
echo "Unquoted : ";
Expand All @@ -42,15 +42,6 @@ echo "Done\n";

?>
--EXPECT--
Unquoted : NULL
Quoted : string(2) "''"
array(1) {
[0]=>
array(1) {
["t"]=>
NULL
}
}
Unquoted : string(0) ""
Quoted : string(2) "''"
array(1) {
Expand Down

0 comments on commit 2db2cab

Please sign in to comment.