summaryrefslogtreecommitdiff
path: root/ext/pdo_pgsql/tests
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-08-11 17:13:32 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-08-11 17:16:38 +0200
commit33028bf014270f94c9407725d9117fa9a5ecec02 (patch)
tree89ac43eaec7bf2fd8df00b8c1ef5079504ffa3b0 /ext/pdo_pgsql/tests
parent8694eb14f437cedb0b1b48be95862272fb818aeb (diff)
parent981af26d7bc742a4cfe34b764a5f32f0e3fc776c (diff)
downloadphp-git-33028bf014270f94c9407725d9117fa9a5ecec02.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
Diffstat (limited to 'ext/pdo_pgsql/tests')
-rw-r--r--ext/pdo_pgsql/tests/bug_64705.phpt17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/pdo_pgsql/tests/bug_64705.phpt b/ext/pdo_pgsql/tests/bug_64705.phpt
new file mode 100644
index 0000000000..464b4d0769
--- /dev/null
+++ b/ext/pdo_pgsql/tests/bug_64705.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #64705 errorInfo property of PDOException is null when PDO::__construct() fails
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo_pgsql')) print 'skip not loaded';
+?>
+--FILE--
+<?php
+$dsn = 'pgsql:host=DonotExistsHost;dbname=test;user=foo;password=wrongpass';
+try {
+ $pdo = new \PDO($dsn, null, null);
+} catch (\PDOException $e) {
+ var_dump(!empty($e->errorInfo) && is_array($e->errorInfo));
+}
+?>
+--EXPECTF--
+bool(true) \ No newline at end of file