summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt
diff options
context:
space:
mode:
authorUlf Wendel <uw@php.net>2009-11-04 12:33:49 +0000
committerUlf Wendel <uw@php.net>2009-11-04 12:33:49 +0000
commite5e58ed47e99be9b2b304a90d8629e6fedab6822 (patch)
treed93179d6a35ca3db5010d0dea7bdb64b37fdba18 /ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt
parente31e228a590b044d0055733737f883b9e8654663 (diff)
downloadphp-git-e5e58ed47e99be9b2b304a90d8629e6fedab6822.tar.gz
Adding CLEAN sections and making tests portable between PHP 5 and PHP 6 by replacing string(n) with %unicode|string%(n) and similar.
Diffstat (limited to 'ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt')
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt78
1 files changed, 8 insertions, 70 deletions
diff --git a/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt
index 8829dc448a..93e1fbf1a2 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt
@@ -14,13 +14,9 @@ $db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db);
function check_error($offset, &$obj, $expected = '00000') {
-
$info = $obj->errorInfo();
- if (count($info) != 3)
- printf("[%03d] Info should have three fields, got %s\n",
- $offset, var_export($info, true));
-
$code = $info[0];
+
if (($code != $expected) && (($expected != '00000') && ($code != ''))) {
printf("[%03d] Expecting error code '%s' got code '%s'\n",
$offset, $expected, $code);
@@ -98,76 +94,18 @@ $db = MySQLPDOTest::factory();
printf("Native Prepared Statements...\n");
pdo_mysql_errorinfo($db, 20);
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Emulated Prepared Statements...
-[002] Info should have three fields, got array (
- 0 => '00000',
-)
-[003] Info should have three fields, got array (
- 0 => '00000',
-)
-[004] Info should have three fields, got array (
- 0 => '00000',
-)
-[005] Info should have three fields, got array (
- 0 => '00000',
-)
-[009] Info should have three fields, got array (
- 0 => '00000',
-)
-[010] Info should have three fields, got array (
- 0 => '00000',
-)
-[013] Info should have three fields, got array (
- 0 => '00000',
-)
-[014] Info should have three fields, got array (
- 0 => '00000',
-)
-[015] Info should have three fields, got array (
- 0 => 'IM001',
-)
[015] Driver-specific error code not set
[015] Driver-specific error message.not set
-[016] Info should have three fields, got array (
- 0 => 'IM001',
-)
[016] Driver-specific error code not set
[016] Driver-specific error message.not set
-[017] Info should have three fields, got array (
- 0 => '00000',
-)
-[018] Info should have three fields, got array (
- 0 => '00000',
-)
Native Prepared Statements...
-[022] Info should have three fields, got array (
- 0 => '00000',
-)
-[023] Info should have three fields, got array (
- 0 => '00000',
-)
-[024] Info should have three fields, got array (
- 0 => '00000',
-)
-[025] Info should have three fields, got array (
- 0 => '00000',
-)
-[030] Info should have three fields, got array (
- 0 => '00000',
-)
-[033] Info should have three fields, got array (
- 0 => '00000',
-)
-[034] Info should have three fields, got array (
- 0 => '00000',
-)
-[037] Info should have three fields, got array (
- 0 => '00000',
-)
-[038] Info should have three fields, got array (
- 0 => '00000',
-)
-done! \ No newline at end of file
+done!