Author: ahristov
Date: 2008-02-20 19:31:45 +0100 (Wed, 20 Feb 2008)
New Revision: 1294
Modified:
trunk/tests/ext/mysqli/bug34810.phpt
trunk/tests/ext/mysqli/mysqli_constants.phpt
trunk/tests/ext/mysqli/mysqli_stmt_bind_result_references.phpt
Log:
Fix tests
Modified: trunk/tests/ext/mysqli/bug34810.phpt
===================================================================
--- trunk/tests/ext/mysqli/bug34810.phpt 2008-02-20 18:29:31 UTC (rev 1293)
+++ trunk/tests/ext/mysqli/bug34810.phpt 2008-02-20 18:31:45 UTC (rev 1294)
@@ -23,7 +23,7 @@
$mysql->query("CREATE TABLE test_warnings (a int not null)");
$mysql->query("SET sql_mode=''");
$mysql->query("INSERT INTO test_warnings VALUES (1),(2),(NULL)");
- var_dump(mysqli_warning::__construct($mysql));
+ var_dump(new mysqli_warning($mysql));
}
}
Modified: trunk/tests/ext/mysqli/mysqli_constants.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_constants.phpt 2008-02-20 18:29:31 UTC (rev 1293)
+++ trunk/tests/ext/mysqli/mysqli_constants.phpt 2008-02-20 18:31:45 UTC (rev 1294)
@@ -44,6 +44,8 @@
"MYSQLI_TIMESTAMP_FLAG" => true,
"MYSQLI_SET_FLAG" => true,
"MYSQLI_NUM_FLAG" => true,
+ "MYSQLI_ENUM_FLAG" => true,
+ "MYSQLI_BINARY_FLAG" => true,
"MYSQLI_PART_KEY_FLAG" => true,
"MYSQLI_GROUP_FLAG" => true,
"MYSQLI_TYPE_DECIMAL" => true,
@@ -90,10 +92,16 @@
$version = 50007 + 1;
$expected_constants['MYSQLI_OPT_NET_CMD_BUFFER_SIZE'] = true;
$expected_constants['MYSQLI_OPT_NET_READ_BUFFER_SIZE'] = true;
+ $expected_constants['MYSQLI_DEBUG_TRACE_ENABLED'] = true;
+
} else {
$version = mysqli_get_client_version();
}
+ if (($version > 51122 && $version < 60000) || ($version > 60003) ||
$IS_MYSQLND) {
+ $expected_constants['MYSQLI_ON_UPDATE_NOW_FLAG'] = true;
+ }
+
if ($version > 50002) {
$expected_constants = array_merge($expected_constants, array(
"MYSQLI_TYPE_NEWDECIMAL" => true,
@@ -101,6 +109,10 @@
));
}
+ if ($version > 50002 || $IS_MYSQLND) {
+ $expected_constants['MYSQLI_NO_DEFAULT_VALUE_FLAG'] = true;
+ }
+
if ($version > 50003) {
$expected_constants = array_merge($expected_constants, array(
"MYSQLI_STMT_ATTR_CURSOR_TYPE" => true,
@@ -133,22 +145,7 @@
$expected_constants["MYSQLI_RPL_ADMIN"] = true;
}
- /* TODO - a bit of a hack */
- if (defined("MYSQLI_ENUM_FLAG"))
- $expected_constants["MYSQLI_ENUM_FLAG"] = true;
- if (defined("MYSQLI_BINARY_FLAG"))
- $expected_constants["MYSQLI_BINARY_FLAG"] = true;
-
- if (defined("MYSQLI_NO_DEFAULT_VALUE_FLAG"))
- $expected_constants["MYSQLI_NO_DEFAULT_VALUE_FLAG"] = true;
-
- if (defined("MYSQLI_ON_UPDATE_NOW_FLAG"))
- $expected_constants["MYSQLI_ON_UPDATE_NOW_FLAG"] = true;
-
- if (defined("MYSQLI_ASYNC"))
- $expected_constants["MYSQLI_ASYNC"] = true;
-
$unexpected_constants = array();
foreach ($constants as $group => $consts) {
Modified: trunk/tests/ext/mysqli/mysqli_stmt_bind_result_references.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_stmt_bind_result_references.phpt 2008-02-20 18:29:31 UTC
(rev 1293)
+++ trunk/tests/ext/mysqli/mysqli_stmt_bind_result_references.phpt 2008-02-20 18:31:45 UTC
(rev 1294)
@@ -25,7 +25,7 @@
if (true !== ($tmp = mysqli_stmt_bind_result($stmt, $id, $label)))
printf("[002] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt))
+ if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt) ||
mysqli_stmt_fetch($stmt))
printf("[003] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
var_dump($id);
@@ -42,7 +42,7 @@
if (true !== ($tmp = mysqli_stmt_bind_result($stmt, $id_ref, $label_ref)))
printf("[004] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt))
+ if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt) ||
mysqli_stmt_fetch($stmt))
printf("[005] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
var_dump($id_ref);
var_dump($id);
@@ -62,7 +62,7 @@
if (true !== ($tmp = mysqli_stmt_bind_result($stmt, $id_ref_ref, $label_ref_ref)))
printf("[006] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt))
+ if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt) ||
mysqli_stmt_fetch($stmt))
printf("[007] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
var_dump($id_ref_ref);
var_dump($id_ref);
@@ -81,7 +81,7 @@
if (true !== ($tmp = mysqli_stmt_bind_result($stmt, $id_ref, $label_ref)))
printf("[008] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt))
+ if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt) ||
mysqli_stmt_fetch($stmt))
printf("[009] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
var_dump($id_ref);
var_dump($id);
@@ -95,7 +95,7 @@
if (true !== ($tmp = mysqli_stmt_bind_result($stmt, $id, $label)))
printf("[010] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt))
+ if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt) ||
mysqli_stmt_fetch($stmt))
printf("[011] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
var_dump($id);
@@ -110,7 +110,7 @@
if (true !== ($tmp = mysqli_stmt_bind_result($stmt, $obj->id, $obj->label)))
printf("[012] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt))
+ if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt) ||
mysqli_stmt_fetch($stmt))
printf("[013] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
var_dump($obj->id);
@@ -128,7 +128,7 @@
if (true !== ($tmp = mysqli_stmt_bind_result($stmt, $id, $label)))
printf("[012] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt))
+ if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt) ||
mysqli_stmt_fetch($stmt))
printf("[013] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
var_dump($obj->id);
@@ -148,7 +148,7 @@
$label = &$obj->id;
$id = null;
- if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt))
+ if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt) ||
mysqli_stmt_fetch($stmt))
printf("[013] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
var_dump($obj->id);
@@ -169,7 +169,7 @@
$id_ref = 1;
$label_ref = 1;
- if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt))
+ if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt) ||
mysqli_stmt_fetch($stmt))
printf("[015] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
var_dump($id_ref);
var_dump($id);
@@ -184,7 +184,7 @@
if (true !== ($tmp = mysqli_stmt_bind_result($stmt, $id, $label_a)))
printf("[016] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt))
+ if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt) ||
mysqli_stmt_fetch($stmt))
printf("[017] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
var_dump($id);
@@ -208,7 +208,7 @@
if (true !== ($tmp = mysqli_stmt_bind_result($stmt, $id, $label_ref)))
printf("[018] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt))
+ if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt) ||
mysqli_stmt_fetch($stmt))
printf("[019] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
var_dump($id);
@@ -231,7 +231,7 @@
if (true !== ($tmp = mysqli_stmt_bind_result($stmt, $id, $label)))
printf("[020] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt))
+ if (!mysqli_stmt_execute($stmt) || !mysqli_stmt_fetch($stmt) ||
mysqli_stmt_fetch($stmt))
printf("[021] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
var_dump($id);
var_dump($label);
@@ -375,4 +375,4 @@
[u"foo"]=>
&unicode(1) "a"
}
-done!
\ No newline at end of file
+done!
| Thread |
|---|
| • PHP mysqlnd svn commit: r1294 - trunk/tests/ext/mysqli | ahristov | 20 Feb |