- Fixed tests

This commit is contained in:
Felipe Pena 2010-12-04 12:28:23 +00:00
parent 11a3a52fc8
commit 57fc653c05
2 changed files with 14 additions and 2 deletions

View 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);

View 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