summaryrefslogtreecommitdiff
path: root/ext/mysqli/tests/mysqli_options.phpt
diff options
context:
space:
mode:
authorUlf Wendel <uw@php.net>2009-09-21 15:59:22 +0000
committerUlf Wendel <uw@php.net>2009-09-21 15:59:22 +0000
commitdecdb55cef65b901a575c758a785f17d6983e993 (patch)
treeb53b94422ba63fc7fb27c7aef1c6fe0cfd950ae8 /ext/mysqli/tests/mysqli_options.phpt
parent16be7ee5c58efa14f3231a373818d850e5594666 (diff)
downloadphp-git-decdb55cef65b901a575c758a785f17d6983e993.tar.gz
Fixing test
Diffstat (limited to 'ext/mysqli/tests/mysqli_options.phpt')
-rw-r--r--ext/mysqli/tests/mysqli_options.phpt20
1 files changed, 9 insertions, 11 deletions
diff --git a/ext/mysqli/tests/mysqli_options.phpt b/ext/mysqli/tests/mysqli_options.phpt
index 2a1e25c290..670f9aca75 100644
--- a/ext/mysqli/tests/mysqli_options.phpt
+++ b/ext/mysqli/tests/mysqli_options.phpt
@@ -43,7 +43,7 @@ already through other measures.
$valid_options[] = constant('MYSQLI_OPT_INT_AND_FLOAT_NATIVE');
if (defined('MYSQLI_OPT_NUMERIC_AND_DATETIME_AS_UNICODE'))
$valid_options[] = constant('MYSQLI_OPT_NUMERIC_AND_DATETIME_AS_UNICODE');
-
+
$tmp = NULL;
$link = NULL;
@@ -85,11 +85,14 @@ already through other measures.
!($tmp = mysqli_options($link, constant('MYSQLI_OPT_NUMERIC_AND_DATETIME_AS_UNICODE'), true)))
printf("[006] Expecting boolean/true got %s/%s\n", gettype($tmp), $tmp);
- for ($flag = -10000; $flag < 10000; $flag++) {
- if (in_array($flag, $valid_options))
- continue;
- if (FALSE !== ($tmp = mysqli_options($link, $flag, 'definetely not an mysqli_option'))) {
- var_dump("SOME_FLAG", $flag, $tmp);
+ if ($IS_MYSQLND) {
+ /* Don't do this with libmysql. You may hit options not exported to PHP and cause false positives */
+ for ($flag = -10000; $flag < 10000; $flag++) {
+ if (in_array($flag, $valid_options))
+ continue;
+ if (FALSE !== ($tmp = mysqli_options($link, $flag, 'definetely not an mysqli_option'))) {
+ var_dump(array("SOME_FLAG" => $flag, "ret" => $tmp));
+ }
}
}
@@ -97,7 +100,6 @@ already through other measures.
echo "Link closed";
var_dump("MYSQLI_INIT_COMMAND", mysqli_options($link, MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT=1'));
- var_dump("SOME_RANDOM_FLAG", mysqli_options($link, $flag, 'definetly not an mysqli_option'));
print "done!";
?>
--EXPECTF--
@@ -127,8 +129,4 @@ Link closed
Warning: mysqli_options(): Couldn't fetch mysqli in %s line %d
%s(19) "MYSQLI_INIT_COMMAND"
NULL
-
-Warning: mysqli_options(): Couldn't fetch mysqli in %s line %d
-%s(16) "SOME_RANDOM_FLAG"
-NULL
done!