From 608802fa56b07fca7ed27df97527b9b57791271b Mon Sep 17 00:00:00 2001 From: NickSdot Date: Tue, 4 Aug 2026 13:03:15 +0000 Subject: [PATCH 1/2] ext/pdo: applied fixers to improve test robustness --- ext/pdo/tests/bug_77849_2.phpt | 2 +- ext/pdo/tests/pdo_036.phpt | 4 ++-- ext/pdo/tests/pdo_uninitialized.phpt | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ext/pdo/tests/bug_77849_2.phpt b/ext/pdo/tests/bug_77849_2.phpt index 3e481eedb1e1..a12b6ce5e90b 100644 --- a/ext/pdo/tests/bug_77849_2.phpt +++ b/ext/pdo/tests/bug_77849_2.phpt @@ -9,7 +9,7 @@ try { $stmt = new PDOStatement(); clone $stmt; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> 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 From d19a2242f5495339b3733f11c66ff8609e8cbef9 Mon Sep 17 00:00:00 2001 From: NickSdot <32384907+NickSdot@users.noreply.github.com> Date: Sun, 9 Aug 2026 21:14:32 +0700 Subject: [PATCH 2/2] review: undo double quotes Co-authored-by: Kamil Tekiela --- ext/pdo/tests/bug_77849_2.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pdo/tests/bug_77849_2.phpt b/ext/pdo/tests/bug_77849_2.phpt index a12b6ce5e90b..3e481eedb1e1 100644 --- a/ext/pdo/tests/bug_77849_2.phpt +++ b/ext/pdo/tests/bug_77849_2.phpt @@ -9,7 +9,7 @@ try { $stmt = new PDOStatement(); clone $stmt; } catch (Throwable $e) { - echo $e::class, ': ', $e->getMessage(), PHP_EOL; + echo $e::class, ": ", $e->getMessage(), PHP_EOL; } ?>