[PHP-CVS] [php-src] master: ext/pdo: applied fixers to improve test robustness (#23023)
[email protected] (NickSdot via GitHub)
| Newsgroups | php.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: NickSdot (NickSdot)
Committer: GitHub (web-flow)
Pusher: kamil-tekiela
Date: 2026-08-09T15:27:40+01:00
Commit: https://github.com/php/php-src/commit/aa847c0bdf04023aebb7b4b74b5dcbf6c909aa3b
Raw diff: https://github.com/php/php-src/commit/aa847c0bdf04023aebb7b4b74b5dcbf6c909aa3b.diff
ext/pdo: applied fixers to improve test robustness (#23023)
Changed paths:
M ext/pdo/tests/pdo_036.phpt
M ext/pdo/tests/pdo_uninitialized.phpt
Diff:
diff --git a/ext/pdo/tests/pdo_036.phpt b/ext/pdo/tests/pdo_036.phpt
index 10fe22193017..113c4f055501 100644
--- a/ext/pdo/tests/pdo_036.phpt
+++ b/ext/pdo/tests/pdo_036.phpt
@@ -17,7 +17,7 @@ try {
$x->queryString = "SELECT 2";
var_dump($x);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$instance = new reflectionclass('pdorow');
@@ -34,7 +34,7 @@ object(PDOStatement)#2 (1) {
["queryString"]=>
string(8) "SELECT 1"
}
-Property queryString is read only
+Error: Property queryString is read only
Fatal error: Uncaught PDOException: You may not create a PDORow manually in %spdo_036.php:%d
Stack trace:
diff --git a/ext/pdo/tests/pdo_uninitialized.phpt b/ext/pdo/tests/pdo_uninitialized.phpt
index e3b4c96af811..792776ea4ab6 100644
--- a/ext/pdo/tests/pdo_uninitialized.phpt
+++ b/ext/pdo/tests/pdo_uninitialized.phpt
@@ -16,24 +16,24 @@ $pdo = new MyPDO;
try {
$pdo->query("foo");
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$stmt = new MyPDOStatement;
try {
$stmt->fetch();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$stmt = new MyPDOStatement;
try {
foreach ($stmt as $row) {}
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-MyPDO object is uninitialized
-MyPDOStatement object is uninitialized
-MyPDOStatement object is uninitialized
+Error: MyPDO object is uninitialized
+Error: MyPDOStatement object is uninitialized
+Error: MyPDOStatement object is uninitialized