diff options
author | Matteo Beccati <mbeccati@php.net> | 2009-12-25 20:11:07 +0000 |
---|---|---|
committer | Matteo Beccati <mbeccati@php.net> | 2009-12-25 20:11:07 +0000 |
commit | 9326c7e3a2290864fa22f3a70f79ab471b2f9590 (patch) | |
tree | 7878be69d15c676b1bd03cb0ddf0c515ced954a8 /ext | |
parent | db8e4a089c656907bd20bf33258399d4f89fe87e (diff) | |
download | php-git-9326c7e3a2290864fa22f3a70f79ab471b2f9590.tar.gz |
- Updated pdo_pgsql tests to be 8.5+ friendly
Diffstat (limited to 'ext')
-rw-r--r-- | ext/pdo/tests/bug_44861.phpt | 2 | ||||
-rw-r--r-- | ext/pdo_pgsql/tests/bug_33876.phpt | 10 | ||||
-rw-r--r-- | ext/pdo_pgsql/tests/bug_49985.phpt | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/ext/pdo/tests/bug_44861.phpt b/ext/pdo/tests/bug_44861.phpt index a392372904..3612561ed6 100644 --- a/ext/pdo/tests/bug_44861.phpt +++ b/ext/pdo/tests/bug_44861.phpt @@ -32,7 +32,7 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci') { $from = ''; } -$query = "SELECT 'row1' AS r $from UNION SELECT 'row2' $from UNION SELECT 'row3' $from UNION SELECT 'row4' $from"; +$query = "SELECT 'row1' AS r $from UNION SELECT 'row2' $from UNION SELECT 'row3' $from UNION SELECT 'row4' $from ORDER BY r"; $aParams = array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL); $res = $db->prepare($query, $aParams); 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(); } } |