]> granicus.if.org Git - php/commitdiff
- Fixed tests
authorFelipe Pena <felipe@php.net>
Sat, 4 Dec 2010 12:28:23 +0000 (12:28 +0000)
committerFelipe Pena <felipe@php.net>
Sat, 4 Dec 2010 12:28:23 +0000 (12:28 +0000)
ext/pdo/tests/bug_38253.phpt
ext/pdo/tests/pdo_018.phpt

index ba937a052a4a477a95e08ab98b82a2dd72965b12..4453c3bb23b76f2112830d9d3b5fc28f1ab65c32 100644 (file)
@@ -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);
index a57c6b726122565ef47a3d59ef9e13bbf8d87cab..7f27ce36e58dfb3fa7a51365b83686cef2ed6829 100644 (file)
@@ -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