[php-src] master: ext/pgsql: applied fixers to improve test robustness (#23040)

NickSdot via GitHub <[email protected]>
Newsgroups gmane.comp.php.cvs.general
Message-ID <[email protected]>
Author: NickSdot (NickSdot)
Committer: GitHub (web-flow)
Pusher: devnexen
Date: 2026-08-04T18:13:33+01:00

Commit: https://github.com/php/php-src/commit/4905ce8e55b72231ccec8b7367b75146493b1dcf
Raw diff: https://github.com/php/php-src/commit/4905ce8e55b72231ccec8b7367b75146493b1dcf.diff

ext/pgsql: applied fixers to improve test robustness (#23040)

Changed paths:
  M  ext/pgsql/tests/gh17158.phpt
  M  ext/pgsql/tests/no_link_open.phpt


Diff:

diff --git a/ext/pgsql/tests/gh17158.phpt b/ext/pgsql/tests/gh17158.phpt
index ade47ededed1..0b7c47ff7d90 100644
--- a/ext/pgsql/tests/gh17158.phpt
+++ b/ext/pgsql/tests/gh17158.phpt
@@ -8,9 +8,9 @@ pgsql
 try {
     pg_fetch_result(null);
 } catch (ArgumentCountError $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECT--
-pg_fetch_result() expects at least 2 arguments, 1 given
+ArgumentCountError: pg_fetch_result() expects at least 2 arguments, 1 given
diff --git a/ext/pgsql/tests/no_link_open.phpt b/ext/pgsql/tests/no_link_open.phpt
index 4a94401f3e6e..b44592c9ea14 100644
--- a/ext/pgsql/tests/no_link_open.phpt
+++ b/ext/pgsql/tests/no_link_open.phpt
@@ -8,10 +8,10 @@ pgsql
 try {
     pg_dbname();
 } catch (Error $e) {
-    echo $e->getMessage(), "\n";
+    echo $e::class, ': ', $e->getMessage(), "\n";
 }
 
 ?>
 --EXPECTF--
 Deprecated: pg_dbname(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
-No PostgreSQL connection opened yet
+Error: No PostgreSQL connection opened yet
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.