Author: uwendel
Date: 2008-04-03 10:56:59 +0200 (Thu, 03 Apr 2008)
New Revision: 1369
Modified:
trunk/tests/ext/pdo/pdo_errorcode.phpt
trunk/tests/ext/pdo/pdo_errorinfo.phpt
trunk/tests/ext/pdo/pdo_get_available_drivers.phpt
trunk/tests/ext/pdo/pdo_stmt_columncount.phpt
trunk/tests/ext/pdo/pdo_stmt_errorcode.phpt
trunk/tests/ext/pdo/pdo_stmt_errorinfo.phpt
Log:
Parameter handling seems to be different (updated) for some functions, adapting tests
Modified: trunk/tests/ext/pdo/pdo_errorcode.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_errorcode.phpt 2008-04-02 14:37:07 UTC (rev 1368)
+++ trunk/tests/ext/pdo/pdo_errorcode.phpt 2008-04-03 08:56:59 UTC (rev 1369)
@@ -14,8 +14,8 @@
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory('PDO', false);
-if (false !== ($tmp = $db->errorCode("too many arguments")))
- printf("[001] Expecting boolean/false got %s/%s\n", $tmp, gettype($tmp));
+if (NULL !== ($tmp = @$db->errorCode("too many arguments")))
+ printf("[001] Expecting NULL got %s/%s\n", $tmp, gettype($tmp));
if ('' !== ($tmp = $db->errorCode()))
printf("[002] Expecting empty string got %s/%s\n", $tmp, gettype($tmp));
Modified: trunk/tests/ext/pdo/pdo_errorinfo.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_errorinfo.phpt 2008-04-02 14:37:07 UTC (rev 1368)
+++ trunk/tests/ext/pdo/pdo_errorinfo.phpt 2008-04-03 08:56:59 UTC (rev 1369)
@@ -70,7 +70,7 @@
$tmp = $db->errorInfo();
var_dump($tmp);
-if (NULL !== ($tmp = $db->errorInfo("too many arguments")))
+if (NULL !== ($tmp = @$db->errorInfo("too many arguments")))
printf("[002] Expecting NULL got %s/%s\n", $tmp, gettype($tmp));
$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), grp
VARCHAR(10))');
@@ -113,8 +113,6 @@
[0]=>
string(0) ""
}
-
-Warning: Wrong parameter count for PDO::errorInfo() in %s on line %d
[003] Expecting three array elements got array (
0 => '00000',
)/array
Modified: trunk/tests/ext/pdo/pdo_get_available_drivers.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_get_available_drivers.phpt 2008-04-02 14:37:07 UTC (rev 1368)
+++ trunk/tests/ext/pdo/pdo_get_available_drivers.phpt 2008-04-03 08:56:59 UTC (rev 1369)
@@ -15,7 +15,7 @@
$db = PDOTest::factory();
try {
- $tmp = PDO::getAvailableDrivers('args', 'args');
+ $tmp = @PDO::getAvailableDrivers('args', 'args');
if ((false !== $tmp) && (!is_null($tmp)))
printf("[001] Typically functions that get invoked with invalid arguments return NULL
or false, this one returned %s (%s)\n",
gettype($tmp), ((is_scalar($tmp)) ? var_export($tmp, true) : gettype($tmp)));
@@ -75,5 +75,4 @@
print "done!";
?>
--EXPECTF--
-Warning: Wrong parameter count for PDO::getAvailableDrivers() in %s on line %d
-done!
+done!
\ No newline at end of file
Modified: trunk/tests/ext/pdo/pdo_stmt_columncount.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_stmt_columncount.phpt 2008-04-02 14:37:07 UTC (rev 1368)
+++ trunk/tests/ext/pdo/pdo_stmt_columncount.phpt 2008-04-03 08:56:59 UTC (rev 1369)
@@ -22,16 +22,16 @@
$stmt = $db->prepare('SELECT id FROM test WHERE id > ? ORDER BY id ASC');
- if (false !== ($tmp = $stmt->columnCount(1)))
- printf("[002] Expecting boolean/false got %s\n", var_export($tmp, true));
+ if (NULL !== ($tmp = @$stmt->columnCount(1)))
+ printf("[002] Expecting NULL got %s\n", var_export($tmp, true));
$tmp = array();
- if (false !== ($tmp = $stmt->columnCount($tmp)))
- printf("[003] Expecting boolean/false got %s\n", var_export($tmp, true));
+ if (NULL !== ($tmp = @$stmt->columnCount($tmp)))
+ printf("[003] Expecting NULL got %s\n", var_export($tmp, true));
$tmp = new stdClass();
- if (false !== ($tmp = $stmt->columnCount($tmp)))
- printf("[004] Expecting boolean/false got %s\n", var_export($tmp, true));
+ if (NULL !== ($tmp = @$stmt->columnCount($tmp)))
+ printf("[004] Expecting NULL got %s\n", var_export($tmp, true));
$stmt = @$db->prepare('SELECT id FROM test WHERE id > ? ORDER BY id ASC');
if (0 !== ($tmp = $stmt->columnCount()))
Modified: trunk/tests/ext/pdo/pdo_stmt_errorcode.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_stmt_errorcode.phpt 2008-04-02 14:37:07 UTC (rev 1368)
+++ trunk/tests/ext/pdo/pdo_stmt_errorcode.phpt 2008-04-03 08:56:59 UTC (rev 1369)
@@ -25,16 +25,16 @@
if ('' !== ($tmp = $stmt->errorCode()))
printf("[002] Expecting empty string got %s\n", var_export($tmp, true));
- if (false !== ($tmp = $stmt->errorCode('too many arguments')))
- printf("[003] Expecting boolean/false got %s\n", var_export($tmp, true));
+ if (NULL !== ($tmp = @$stmt->errorCode('too many arguments')))
+ printf("[003] Expecting NULL got %s\n", var_export($tmp, true));
$tmp = array();
- if (false !== ($tmp = $stmt->errorCode($tmp)))
- printf("[004] Expecting boolean/false got %s\n", var_export($tmp, true));
+ if (NULL !== ($tmp = @$stmt->errorCode($tmp)))
+ printf("[004] Expecting NULL got %s\n", var_export($tmp, true));
$tmp = new stdClass();
- if (false !== ($tmp = $stmt->errorCode($tmp)))
- printf("[005] Expecting boolean/false got %s\n", var_export($tmp, true));
+ if (NULL !== ($tmp = @$stmt->errorCode($tmp)))
+ printf("[005] Expecting NULL got %s\n", var_export($tmp, true));
$stmt = @$db->prepare('SELECT id FROM ihopeitdoesnotexist WHERE id > ? ORDER BY id
ASC');
@$stmt->execute();
Modified: trunk/tests/ext/pdo/pdo_stmt_errorinfo.phpt
===================================================================
--- trunk/tests/ext/pdo/pdo_stmt_errorinfo.phpt 2008-04-02 14:37:07 UTC (rev 1368)
+++ trunk/tests/ext/pdo/pdo_stmt_errorinfo.phpt 2008-04-03 08:56:59 UTC (rev 1369)
@@ -29,36 +29,36 @@
printf("[003] Expecting SQLSTATE to be either an empty string or '00000', got %s\n",
var_export($tmp[0], true));
- if (false !== ($tmp = $stmt->errorInfo('too many arguments')))
- printf("[003] Expecting boolean/false got %s\n", var_export($tmp, true));
+ if (NULL !== ($tmp = @$stmt->errorInfo('too many arguments')))
+ printf("[004] Expecting NULL got %s\n", var_export($tmp, true));
$tmp = array();
- if (false !== ($tmp = $stmt->errorInfo($tmp)))
- printf("[004] Expecting boolean/false got %s\n", var_export($tmp, true));
+ if (NULL !== ($tmp = @$stmt->errorInfo($tmp)))
+ printf("[005] Expecting NULL got %s\n", var_export($tmp, true));
$tmp = new stdClass();
- if (false !== ($tmp = $stmt->errorInfo($tmp)))
- printf("[005] Expecting boolean/false got %s\n", var_export($tmp, true));
+ if (NULL !== ($tmp = @$stmt->errorInfo($tmp)))
+ printf("[006] Expecting NULL got %s\n", var_export($tmp, true));
$stmt = @$db->prepare('SELECT id FROM ihopeitdoesnotexist WHERE id > ? ORDER BY id
ASC');
@$stmt->execute();
if (!is_array($tmp = $stmt->errorInfo()) || (count($tmp) != 3))
- printf("[006] Expecting array with three elements got %s\n", var_export($tmp, true));
+ printf("[007] Expecting array with three elements got %s\n", var_export($tmp, true));
if (is_array($tmp) && (("" === $tmp[0]) || '00000' === $tmp[0] ||
strlen($tmp[0]) != 5))
- printf("[007] SQLSTATE should set, got %s\n",
+ printf("[008] SQLSTATE should set, got %s\n",
var_export($tmp[0], true));
$stmt2 = $db->prepare('SELECT id FROM test WHERE id > ? ORDER BY id ASC');
if (!is_array($tmp = $stmt2->errorInfo()) || (count($tmp) != 3))
- printf("[008] Expecting array with three elements got %s\n", var_export($tmp, true));
+ printf("[009] Expecting array with three elements got %s\n", var_export($tmp, true));
if (is_array($tmp) && (("" !== $tmp[0]) && '00000' !== $tmp[0]))
- printf("[009] Expecting SQLSTATE to be either an empty string or '00000', got %s\n",
+ printf("[010] Expecting SQLSTATE to be either an empty string or '00000', got %s\n",
var_export($tmp[0], true));
if ($tmp === $stmt->errorInfo())
- printf("[010] Two statement objects seem to influence each other, check manually\n");
+ printf("[011] Two statement objects seem to influence each other, check manually\n");
} catch (PDOException $e) {
// we should never get here, we use warnings, but never trust a system...s
@@ -73,10 +73,10 @@
[002] Expecting array with three elements got array (
0 => '',
)
-[006] Expecting array with three elements got array (
+[007] Expecting array with three elements got array (
0 => '%s',
)
-[008] Expecting array with three elements got array (
+[009] Expecting array with three elements got array (
0 => '',
)
done!
\ No newline at end of file
| Thread |
|---|
| • PHP mysqlnd svn commit: r1369 - trunk/tests/ext/pdo | uwendel | 3 Apr |