summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-12-04 12:40:00 +0000
committerFelipe Pena <felipe@php.net>2010-12-04 12:40:00 +0000
commit0ef0372be20168e78e141fb358708e9dd0532bf0 (patch)
tree85cf2bacabe242298999f4debbdcdf395a311c56
parent8b7fe19996f27662c5118b85765b0e77d77c6669 (diff)
downloadphp-git-0ef0372be20168e78e141fb358708e9dd0532bf0.tar.gz
- Fixed tests
-rw-r--r--ext/pdo/tests/bug_38253.phpt8
-rw-r--r--ext/pdo/tests/bug_43139.phpt7
-rw-r--r--ext/pdo/tests/pdo_018.phpt8
-rw-r--r--ext/pdo/tests/pdo_021.phpt2
4 files changed, 20 insertions, 5 deletions
diff --git a/ext/pdo/tests/bug_38253.phpt b/ext/pdo/tests/bug_38253.phpt
index c89fba866e..b928540f5b 100644
--- a/ext/pdo/tests/bug_38253.phpt
+++ b/ext/pdo/tests/bug_38253.phpt
@@ -24,7 +24,13 @@ var_dump($stmt->fetchAll());
$pdo = PDOTest::factory();
-$pdo->exec ("create table test2 (id integer primary key, n text)");
+if ($pdo->getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci') {
+ $type = "clob";
+} else{
+ $type = "text";
+}
+
+$pdo->exec ("create table test2 (id integer primary key, n $type)");
$pdo->exec ("INSERT INTO test2 (id, n) VALUES (1,'hi')");
$pdo->setAttribute (PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_FUNC);
diff --git a/ext/pdo/tests/bug_43139.phpt b/ext/pdo/tests/bug_43139.phpt
index 04b9bf311e..6f44c91317 100644
--- a/ext/pdo/tests/bug_43139.phpt
+++ b/ext/pdo/tests/bug_43139.phpt
@@ -17,7 +17,12 @@ $db = PDOTest::factory();
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
-var_dump($db->query('select 0 as abc, 1 as xyz, 2 as def')->fetchAll(PDO::FETCH_GROUP));
+$from = '';
+if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci') {
+ $from = 'from dual';
+}
+
+var_dump($db->query("select 0 as abc, 1 as xyz, 2 as def $from")->fetchAll(PDO::FETCH_GROUP));
?>
--EXPECT--
array(1) {
diff --git a/ext/pdo/tests/pdo_018.phpt b/ext/pdo/tests/pdo_018.phpt
index 6a7573f262..30088da5de 100644
--- a/ext/pdo/tests/pdo_018.phpt
+++ b/ext/pdo/tests/pdo_018.phpt
@@ -127,7 +127,13 @@ foreach($objs as $idx => $obj)
unset($stmt);
echo "===DATA===\n";
-var_dump($db->query('SELECT test.val FROM test')->fetchAll(PDO::FETCH_COLUMN));
+$res = $db->query('SELECT test.val FROM test')->fetchAll(PDO::FETCH_COLUMN);
+
+// For Oracle map NULL to empty string so the test doesn't diff
+if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci' && $res[0] === null) {
+ $res[0] = "";
+}
+var_dump($res);
echo "===FAILURE===\n";
try
diff --git a/ext/pdo/tests/pdo_021.phpt b/ext/pdo/tests/pdo_021.phpt
index 688bd4a618..fb25fc52bc 100644
--- a/ext/pdo/tests/pdo_021.phpt
+++ b/ext/pdo/tests/pdo_021.phpt
@@ -41,8 +41,6 @@ $select->execute();
$num = $select->fetchColumn();
echo 'There are ' . $num . " rows in the table.\n";
-$select->closeCursor();
-
// Insert using named parameters
$stmt2 = $db->prepare("INSERT INTO test VALUES(:first, :second, :third)");
foreach ($data as $row) {