Author: uwendel
Date: 2007-06-28 10:00:47 +0200 (Thu, 28 Jun 2007)
New Revision: 548
Added:
trunk/tests/ext/mysqli/mysqli_more_results_php6.phpt
trunk/tests/ext/mysqli/mysqli_more_results_pre_php6.phpt
Removed:
trunk/tests/ext/mysqli/mysqli_more_results.phpt
Log:
Splitting into two tests to pass PHP5 and PHP6
Deleted: trunk/tests/ext/mysqli/mysqli_more_results.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_more_results.phpt 2007-06-28 07:51:53 UTC (rev 547)
+++ trunk/tests/ext/mysqli/mysqli_more_results.phpt 2007-06-28 08:00:47 UTC (rev 548)
@@ -1,82 +0,0 @@
---TEST--
-mysqli_more_results()
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
-<?php require_once('skipifemb.inc'); ?>
---FILE--
-<?php
- include "connect.inc";
-
- error_reporting(E_STRICT | E_WARNING);
-
- $tmp = NULL;
- $link = NULL;
-
- if (!is_null($tmp = @mysqli_more_results()))
- printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
-
- if (!is_null($tmp = @mysqli_more_results($link)))
- printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
-
- require('table.inc');
-
- print "[004]\n";
- var_dump(mysqli_more_results($link));
-
- if (!mysqli_multi_query($link, "SELECT 1 AS a; SELECT 1 AS a, 2 AS b; SELECT id FROM
test ORDER BY id LIMIT 3"))
- printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- print "[006]\n";
- $i = 1;
-
- if (mysqli_get_server_version($link) > 41000 && !($ret =
mysqli_more_results($link)))
- printf("[006a] Expecting boolean/true, got %s/%s\n", gettype($ret), $ret);
- do {
- $res = mysqli_store_result($link);
- mysqli_free_result($res);
- if (mysqli_more_results($link))
- printf("%d\n", $i++);
- } while (mysqli_next_result($link));
-
- if (!mysqli_multi_query($link, "SELECT 1 AS a; SELECT 1 AS a, 2 AS b; SELECT id FROM
test ORDER BY id LIMIT 3"))
- printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- print "[008]\n";
- $i = 1;
- if (mysqli_get_server_version($link) > 41000 && !($ret =
mysqli_more_results($link)))
- printf("[008a] Expecting boolean/true, got %s/%s\n", gettype($ret), $ret);
-
- do {
- $res = mysqli_use_result($link);
- // NOTE: if you use mysqli_use_result() with mysqli_more_results() or any other
info function,
- // you must fetch all rows before you can loop to the next result set!
- // See also the MySQL Reference Manual: mysql_use_result()
- while ($row = mysqli_fetch_array($res))
- ;
- mysqli_free_result($res);
- if (mysqli_more_results($link))
- printf("%d\n", $i++);
-
- } while (mysqli_next_result($link));
-
- mysqli_close($link);
-
- var_dump(mysqli_more_results($link));
-
- print "done!";
-?>
---EXPECTF--
-[004]
-bool(false)
-[006]
-1
-2
-
-Strict Standards: mysqli_next_result(): There is no next result set. Please, call
mysqli_more_results()/mysqli::more_results() to check whether to call this
function/method in %s on line %d
-[008]
-1
-2
-
-Strict Standards: mysqli_next_result(): There is no next result set. Please, call
mysqli_more_results()/mysqli::more_results() to check whether to call this
function/method in %s on line %d
-
-Warning: mysqli_more_results(): Couldn't fetch mysqli in %s on line %d
-NULL
-done!
Added: trunk/tests/ext/mysqli/mysqli_more_results_php6.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_more_results_php6.phpt 2007-06-28 07:51:53 UTC (rev 547)
+++ trunk/tests/ext/mysqli/mysqli_more_results_php6.phpt 2007-06-28 08:00:47 UTC (rev 548)
@@ -0,0 +1,88 @@
+--TEST--
+mysqli_more_results()
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('skipifemb.inc');
+
+$version = explode('.', PHP_VERSION);
+if ($version[0] < 6)
+ die("skip PHP 6 test which checks Strict Standards warnings");
+?>
+--FILE--
+<?php
+ include "connect.inc";
+
+ error_reporting(E_STRICT | E_WARNING);
+
+ $tmp = NULL;
+ $link = NULL;
+
+ if (!is_null($tmp = @mysqli_more_results()))
+ printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+
+ if (!is_null($tmp = @mysqli_more_results($link)))
+ printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+
+ require('table.inc');
+
+ print "[004]\n";
+ var_dump(mysqli_more_results($link));
+
+ if (!mysqli_multi_query($link, "SELECT 1 AS a; SELECT 1 AS a, 2 AS b; SELECT id FROM
test ORDER BY id LIMIT 3"))
+ printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ print "[006]\n";
+ $i = 1;
+
+ if (mysqli_get_server_version($link) > 41000 && !($ret =
mysqli_more_results($link)))
+ printf("[006a] Expecting boolean/true, got %s/%s\n", gettype($ret), $ret);
+ do {
+ $res = mysqli_store_result($link);
+ mysqli_free_result($res);
+ if (mysqli_more_results($link))
+ printf("%d\n", $i++);
+ } while (mysqli_next_result($link));
+
+ if (!mysqli_multi_query($link, "SELECT 1 AS a; SELECT 1 AS a, 2 AS b; SELECT id FROM
test ORDER BY id LIMIT 3"))
+ printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ print "[008]\n";
+ $i = 1;
+ if (mysqli_get_server_version($link) > 41000 && !($ret =
mysqli_more_results($link)))
+ printf("[008a] Expecting boolean/true, got %s/%s\n", gettype($ret), $ret);
+
+ do {
+ $res = mysqli_use_result($link);
+ // NOTE: if you use mysqli_use_result() with mysqli_more_results() or any other
info function,
+ // you must fetch all rows before you can loop to the next result set!
+ // See also the MySQL Reference Manual: mysql_use_result()
+ while ($row = mysqli_fetch_array($res))
+ ;
+ mysqli_free_result($res);
+ if (mysqli_more_results($link))
+ printf("%d\n", $i++);
+
+ } while (mysqli_next_result($link));
+
+ mysqli_close($link);
+
+ var_dump(mysqli_more_results($link));
+
+ print "done!";
+?>
+--EXPECTF--
+[004]
+bool(false)
+[006]
+1
+2
+
+Strict Standards: mysqli_next_result(): There is no next result set. Please, call
mysqli_more_results()/mysqli::more_results() to check whether to call this
function/method in %s on line %d
+[008]
+1
+2
+
+Strict Standards: mysqli_next_result(): There is no next result set. Please, call
mysqli_more_results()/mysqli::more_results() to check whether to call this
function/method in %s on line %d
+
+Warning: mysqli_more_results(): Couldn't fetch mysqli in %s on line %d
+NULL
+done!
Added: trunk/tests/ext/mysqli/mysqli_more_results_pre_php6.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_more_results_pre_php6.phpt 2007-06-28 07:51:53 UTC (rev
547)
+++ trunk/tests/ext/mysqli/mysqli_more_results_pre_php6.phpt 2007-06-28 08:00:47 UTC (rev
548)
@@ -0,0 +1,84 @@
+--TEST--
+mysqli_more_results() - PHP 4, PHP 5 version
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('skipifemb.inc');
+
+$version = explode('.', PHP_VERSION);
+if ($version[0] > 5)
+ die("skip PHP 4/5 test without Strict Standards warnings");
+?>
+--FILE--
+<?php
+ include "connect.inc";
+
+ error_reporting(E_STRICT | E_WARNING);
+
+ $tmp = NULL;
+ $link = NULL;
+
+ if (!is_null($tmp = @mysqli_more_results()))
+ printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+
+ if (!is_null($tmp = @mysqli_more_results($link)))
+ printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+
+ require('table.inc');
+
+ print "[004]\n";
+ var_dump(mysqli_more_results($link));
+
+ if (!mysqli_multi_query($link, "SELECT 1 AS a; SELECT 1 AS a, 2 AS b; SELECT id FROM
test ORDER BY id LIMIT 3"))
+ printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ print "[006]\n";
+ $i = 1;
+
+ if (mysqli_get_server_version($link) > 41000 && !($ret =
mysqli_more_results($link)))
+ printf("[006a] Expecting boolean/true, got %s/%s\n", gettype($ret), $ret);
+ do {
+ $res = mysqli_store_result($link);
+ mysqli_free_result($res);
+ if (mysqli_more_results($link))
+ printf("%d\n", $i++);
+ } while (mysqli_next_result($link));
+
+ if (!mysqli_multi_query($link, "SELECT 1 AS a; SELECT 1 AS a, 2 AS b; SELECT id FROM
test ORDER BY id LIMIT 3"))
+ printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ print "[008]\n";
+ $i = 1;
+ if (mysqli_get_server_version($link) > 41000 && !($ret =
mysqli_more_results($link)))
+ printf("[008a] Expecting boolean/true, got %s/%s\n", gettype($ret), $ret);
+
+ do {
+ $res = mysqli_use_result($link);
+ // NOTE: if you use mysqli_use_result() with mysqli_more_results() or any other
info function,
+ // you must fetch all rows before you can loop to the next result set!
+ // See also the MySQL Reference Manual: mysql_use_result()
+ while ($row = mysqli_fetch_array($res))
+ ;
+ mysqli_free_result($res);
+ if (mysqli_more_results($link))
+ printf("%d\n", $i++);
+
+ } while (mysqli_next_result($link));
+
+ mysqli_close($link);
+
+ var_dump(mysqli_more_results($link));
+
+ print "done!";
+?>
+--EXPECTF--
+[004]
+bool(false)
+[006]
+1
+2
+[008]
+1
+2
+
+Warning: mysqli_more_results(): Couldn't fetch mysqli in %s on line %d
+NULL
+done!
\ No newline at end of file
| Thread |
|---|
| • PHP mysqlnd svn commit: r548 - trunk/tests/ext/mysqli | uwendel | 28 Jun |