summaryrefslogtreecommitdiff
path: root/ext/mysql/tests/mysql_fetch_array.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysql/tests/mysql_fetch_array.phpt')
-rw-r--r--ext/mysql/tests/mysql_fetch_array.phpt162
1 files changed, 46 insertions, 116 deletions
diff --git a/ext/mysql/tests/mysql_fetch_array.phpt b/ext/mysql/tests/mysql_fetch_array.phpt
index 729523514..635e6d109 100644
--- a/ext/mysql/tests/mysql_fetch_array.phpt
+++ b/ext/mysql/tests/mysql_fetch_array.phpt
@@ -1,8 +1,8 @@
--TEST--
mysql_fetch_array()
--SKIPIF--
-<?php
-require_once('skipif.inc');
+<?php
+require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
@@ -56,7 +56,7 @@ exit(1);
do {
$illegal_mode = mt_rand(0, 10000);
} while (in_array($illegal_mode, array(MYSQL_ASSOC, MYSQL_NUM, MYSQL_BOTH)));
-$tmp = @mysql_fetch_array($res, $illegal_mode);
+$tmp = mysql_fetch_array($res, $illegal_mode);
if (!is_array($tmp))
printf("[013] Expecting array, got %s/%s. [%d] %s\n",
gettype($tmp), $tmp, mysql_errno($link), mysql_error($link));
@@ -277,155 +277,85 @@ printf("[015] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
print "done!";
?>
+--CLEAN--
+<?php
+require_once("clean_table.inc");
+?>
--EXPECTF--
[005]
array(4) {
[0]=>
- string(1) "1"
- ["id"]=>
- string(1) "1"
+ %unicode|string%(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
[1]=>
- string(1) "a"
- ["label"]=>
- string(1) "a"
+ %unicode|string%(1) "a"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
[006]
array(2) {
[0]=>
- string(1) "2"
+ %unicode|string%(1) "2"
[1]=>
- string(1) "b"
+ %unicode|string%(1) "b"
}
[007]
array(4) {
[0]=>
- string(1) "3"
- ["id"]=>
- string(1) "3"
+ %unicode|string%(1) "3"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
[1]=>
- string(1) "c"
- ["label"]=>
- string(1) "c"
+ %unicode|string%(1) "c"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "c"
}
[008]
array(2) {
- ["id"]=>
- string(1) "4"
- ["label"]=>
- string(1) "d"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "4"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "d"
}
[009]
array(4) {
[0]=>
- string(1) "5"
- ["id"]=>
- string(1) "5"
+ %unicode|string%(1) "5"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "5"
[1]=>
- string(1) "e"
- ["label"]=>
- string(1) "e"
+ %unicode|string%(1) "e"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "e"
}
[011]
array(11) {
[0]=>
- string(1) "1"
- ["a"]=>
- string(1) "2"
+ %unicode|string%(1) "1"
+ [%u|b%"a"]=>
+ %unicode|string%(1) "2"
[1]=>
- string(1) "2"
+ %unicode|string%(1) "2"
[2]=>
- string(1) "3"
- ["c"]=>
- string(1) "3"
+ %unicode|string%(1) "3"
+ [%u|b%"c"]=>
+ %unicode|string%(1) "3"
[3]=>
- string(1) "4"
- ["C"]=>
- string(1) "4"
+ %unicode|string%(1) "4"
+ [%u|b%"C"]=>
+ %unicode|string%(1) "4"
[4]=>
NULL
- ["d"]=>
+ [%u|b%"d"]=>
NULL
[5]=>
- string(1) "1"
- ["e"]=>
- string(1) "1"
+ %unicode|string%(1) "1"
+ [%u|b%"e"]=>
+ %unicode|string%(1) "1"
}
-Warning: mysql_fetch_array(): %d is not a valid MySQL result resource in %s on line %d
-done!
---UEXPECTF--
-[005]
-array(4) {
- [0]=>
- unicode(1) "1"
- [u"id"]=>
- unicode(1) "1"
- [1]=>
- unicode(1) "a"
- [u"label"]=>
- unicode(1) "a"
-}
-[006]
-array(2) {
- [0]=>
- unicode(1) "2"
- [1]=>
- unicode(1) "b"
-}
-[007]
-array(4) {
- [0]=>
- unicode(1) "3"
- [u"id"]=>
- unicode(1) "3"
- [1]=>
- unicode(1) "c"
- [u"label"]=>
- unicode(1) "c"
-}
-[008]
-array(2) {
- [u"id"]=>
- unicode(1) "4"
- [u"label"]=>
- unicode(1) "d"
-}
-[009]
-array(4) {
- [0]=>
- unicode(1) "5"
- [u"id"]=>
- unicode(1) "5"
- [1]=>
- unicode(1) "e"
- [u"label"]=>
- unicode(1) "e"
-}
-[011]
-array(11) {
- [0]=>
- unicode(1) "1"
- [u"a"]=>
- unicode(1) "2"
- [1]=>
- unicode(1) "2"
- [2]=>
- unicode(1) "3"
- [u"c"]=>
- unicode(1) "3"
- [3]=>
- unicode(1) "4"
- [u"C"]=>
- unicode(1) "4"
- [4]=>
- NULL
- [u"d"]=>
- NULL
- [5]=>
- unicode(1) "1"
- [u"e"]=>
- unicode(1) "1"
-}
+Warning: mysql_fetch_array(): The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH in %s on line %d
Warning: mysql_fetch_array(): %d is not a valid MySQL result resource in %s on line %d
done!