From 57fc653c0566a39c417a56a239805689553b36d9 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Sat, 4 Dec 2010 12:28:23 +0000 Subject: [PATCH] - Fixed tests --- ext/pdo/tests/bug_38253.phpt | 8 +++++++- ext/pdo/tests/pdo_018.phpt | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ext/pdo/tests/bug_38253.phpt b/ext/pdo/tests/bug_38253.phpt index ba937a052a4..4453c3bb23b 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/pdo_018.phpt b/ext/pdo/tests/pdo_018.phpt index a57c6b72612..7f27ce36e58 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