From 526fde9a66a7189d2705bbcd944c5929666bf62c Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Fri, 25 Dec 2009 20:11:07 +0000 Subject: [PATCH] - Updated pdo_pgsql tests to be 8.5+ friendly --- ext/pdo_pgsql/tests/bug_33876.phpt | 10 +++++++--- ext/pdo_pgsql/tests/bug_49985.phpt | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ext/pdo_pgsql/tests/bug_33876.phpt b/ext/pdo_pgsql/tests/bug_33876.phpt index 0ec04e8bd9..48618e13db 100644 --- a/ext/pdo_pgsql/tests/bug_33876.phpt +++ b/ext/pdo_pgsql/tests/bug_33876.phpt @@ -80,10 +80,14 @@ else # Expected to fail; unless told otherwise, PDO assumes string inputs # false -> "" as string, which pgsql doesn't like -if (!$res->execute(array(false))) - print_r($res->errorInfo()); -else +if (!$res->execute(array(false))) { + $err = $res->errorInfo(); + // Strip additional lines ouputted by recent PgSQL versions + $err[2] = trim(current(explode("\n", $err[2]))); + print_r($err); +} else { print_r($res->fetchAll(PDO::FETCH_ASSOC)); +} diff --git a/ext/pdo_pgsql/tests/bug_49985.phpt b/ext/pdo_pgsql/tests/bug_49985.phpt index 7ada87630a..26dcfc617d 100644 --- a/ext/pdo_pgsql/tests/bug_49985.phpt +++ b/ext/pdo_pgsql/tests/bug_49985.phpt @@ -22,7 +22,7 @@ for ($i = 0; $i < 3; $i++) { var_dump($stmt->execute(array(1))); $db->commit(); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo trim(current(explode("\n", $e->getMessage())))."\n"; $db->rollback(); } } -- 2.50.1