Author: uwendel
Date: 2007-07-19 10:04:21 +0200 (Thu, 19 Jul 2007)
New Revision: 795
Modified:
trunk/tests/ext/mysqli/mysqli_connect_twice.phpt
trunk/tests/ext/mysqli/mysqli_real_escape_string.phpt
trunk/tests/ext/mysqli/mysqli_real_escape_string_unicode.phpt
trunk/tests/ext/mysqli/mysqli_real_query.phpt
Log:
Spac2Tab and minor tweak of the UEXPECTF from connecto_twice
Modified: trunk/tests/ext/mysqli/mysqli_connect_twice.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_connect_twice.phpt 2007-07-19 07:56:59 UTC (rev 794)
+++ trunk/tests/ext/mysqli/mysqli_connect_twice.phpt 2007-07-19 08:04:21 UTC (rev 795)
@@ -81,11 +81,11 @@
done!
--UEXPECTF--
array(1) {
- ["it_works"]=>
+ [u"it_works"]=>
unicode(2) "ok"
}
array(1) {
- ["syntax"]=>
+ [u"syntax"]=>
unicode(18) "works also with oo"
}
done!
\ No newline at end of file
Modified: trunk/tests/ext/mysqli/mysqli_real_escape_string.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_real_escape_string.phpt 2007-07-19 07:56:59 UTC (rev
794)
+++ trunk/tests/ext/mysqli/mysqli_real_escape_string.phpt 2007-07-19 08:04:21 UTC (rev
795)
@@ -5,51 +5,51 @@
<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
- include "connect.inc";
-
- $tmp = NULL;
- $link = NULL;
-
- if (NULL !== ($tmp = @mysqli_real_escape_string()))
- printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
-
- if (NULL !== ($tmp = @mysqli_real_escape_string($link)))
- printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
-
- require('table.inc');
-
- if (NULL !== ($tmp =@mysqli_real_escape_string($link, "foo", "foo")))
- printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
-
- if ('\\\\' !== ($tmp = mysqli_real_escape_string($link, '\\')))
- printf("[004] Expecting \\\\, got %s\n", $tmp);
-
- if ('\"' !== ($tmp = mysqli_real_escape_string($link, '"')))
- printf("[005] Expecting \", got %s\n", $tmp);
+ include "connect.inc";
- if ("\'" !== ($tmp = mysqli_real_escape_string($link, "'")))
- printf("[006] Expecting ', got %s\n", $tmp);
-
- if ("\\n" !== ($tmp = mysqli_real_escape_string($link, "\n")))
- printf("[007] Expecting \\n, got %s\n", $tmp);
-
- if ("\\r" !== ($tmp = mysqli_real_escape_string($link, "\r")))
- printf("[008] Expecting \\r, got %s\n", $tmp);
-
- if ("foo\\0bar" !== ($tmp = mysqli_real_escape_string($link, "foo" . chr(0) .
"bar")))
- printf("[009] Expecting %s, got %s\n", "foo\\0bar", $tmp);
-
- mysqli_close($link);
-
- if (NULL !== ($tmp = mysqli_real_escape_string($link, 'foo')))
- printf("[010] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
-
- /* Make sure that the function alias exists */
- if (NULL !== ($tmp = @mysqli_escape_string()))
- printf("[011] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
-
- print "done!";
+ $tmp = NULL;
+ $link = NULL;
+
+ if (NULL !== ($tmp = @mysqli_real_escape_string()))
+ printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+
+ if (NULL !== ($tmp = @mysqli_real_escape_string($link)))
+ printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+
+ require('table.inc');
+
+ if (NULL !== ($tmp =@mysqli_real_escape_string($link, "foo", "foo")))
+ printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+
+ if ('\\\\' !== ($tmp = mysqli_real_escape_string($link, '\\')))
+ printf("[004] Expecting \\\\, got %s\n", $tmp);
+
+ if ('\"' !== ($tmp = mysqli_real_escape_string($link, '"')))
+ printf("[005] Expecting \", got %s\n", $tmp);
+
+ if ("\'" !== ($tmp = mysqli_real_escape_string($link, "'")))
+ printf("[006] Expecting ', got %s\n", $tmp);
+
+ if ("\\n" !== ($tmp = mysqli_real_escape_string($link, "\n")))
+ printf("[007] Expecting \\n, got %s\n", $tmp);
+
+ if ("\\r" !== ($tmp = mysqli_real_escape_string($link, "\r")))
+ printf("[008] Expecting \\r, got %s\n", $tmp);
+
+ if ("foo\\0bar" !== ($tmp = mysqli_real_escape_string($link, "foo" . chr(0) . "bar")))
+ printf("[009] Expecting %s, got %s\n", "foo\\0bar", $tmp);
+
+ mysqli_close($link);
+
+ if (NULL !== ($tmp = mysqli_real_escape_string($link, 'foo')))
+ printf("[010] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+
+ /* Make sure that the function alias exists */
+ if (NULL !== ($tmp = @mysqli_escape_string()))
+ printf("[011] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+
+ print "done!";
?>
--EXPECTF--
Warning: mysqli_real_escape_string(): Couldn't fetch mysqli in %s on line %d
-done!
+done!
\ No newline at end of file
Modified: trunk/tests/ext/mysqli/mysqli_real_escape_string_unicode.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_real_escape_string_unicode.phpt 2007-07-19 07:56:59 UTC
(rev 794)
+++ trunk/tests/ext/mysqli/mysqli_real_escape_string_unicode.phpt 2007-07-19 08:04:21 UTC
(rev 795)
@@ -7,7 +7,6 @@
<?php
include "connect.inc";
- $dbname = 'test';
$tmp = NULL;
$link = NULL;
@@ -29,7 +28,7 @@
printf("[005] Expecting бар\"фус, got %s\n", $tmp);
if ("лала\'лали" !== ($tmp = mysqli_real_escape_string($link,
"лала'лали")))
- printf("[006] Expecting лала'лали, got %s\n", $tmp);
+ printf("[006] Expecting лала'лали, got %s\n", $tmp);
if ("абра\\nкадабра" !== ($tmp = mysqli_real_escape_string($link,
"абра\nкадабра")))
printf("[007] Expecting абра\\nкадабра, got %s\n", $tmp);
@@ -53,7 +52,7 @@
printf("[012] Expecting 酒吧\"小题大做, got %s\n", $tmp);
if ("拉拉\'西雅图" !== ($tmp = mysqli_real_escape_string($link,
"拉拉'西雅图")))
- printf("[013] Expecting 拉拉'西雅图, got %s\n", $tmp);
+ printf("[013] Expecting 拉拉'西雅图, got %s\n", $tmp);
if ("阿卜拉\\n轻" !== ($tmp = mysqli_real_escape_string($link, "阿卜拉\n轻")))
printf("[014] Expecting 阿卜拉\\n轻, got %s\n", $tmp);
@@ -70,14 +69,13 @@
printf("[017] Expecting %s, got %s\n", $exp, $tmp, var_dump($exp, $tmp));
}
-
mysqli_close($link);
if (NULL !== ($tmp = mysqli_real_escape_string($link, 'foo')))
printf("[018] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
-
+
print "done!";
?>
--EXPECTF--
Warning: mysqli_real_escape_string(): Couldn't fetch mysqli in %s on line %d
-done!
+done!
\ No newline at end of file
Modified: trunk/tests/ext/mysqli/mysqli_real_query.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_real_query.phpt 2007-07-19 07:56:59 UTC (rev 794)
+++ trunk/tests/ext/mysqli/mysqli_real_query.phpt 2007-07-19 08:04:21 UTC (rev 795)
@@ -4,87 +4,87 @@
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
- include "connect.inc";
-
- $tmp = NULL;
- $link = NULL;
-
- if (!is_null($tmp = @mysqli_real_query()))
- printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+ include "connect.inc";
- if (!is_null($tmp = @mysqli_real_query($link)))
- printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+ $tmp = NULL;
+ $link = NULL;
- require('table.inc');
+ if (!is_null($tmp = @mysqli_real_query()))
+ printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
- if (NULL !== ($tmp = @mysqli_real_query($link, "SELECT 1 AS a", MYSQLI_USE_RESULT,
"foo")))
- printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+ if (!is_null($tmp = @mysqli_real_query($link)))
+ printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
- if (false !== ($tmp = mysqli_real_query($link, 'THIS IS NOT SQL')))
- printf("[004] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
+ require('table.inc');
- if (false !== ($tmp = mysqli_real_query($link, 'SELECT "this is sql but with
backslash g"\g')))
- printf("[005] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
+ if (NULL !== ($tmp = @mysqli_real_query($link, "SELECT 1 AS a", MYSQLI_USE_RESULT,
"foo")))
+ printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
- if ((0 === mysqli_errno($link)) || ('' == mysqli_error($link)))
- printf("[006] mysqli_errno()/mysqli_error should return some error\n");
+ if (false !== ($tmp = mysqli_real_query($link, 'THIS IS NOT SQL')))
+ printf("[004] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_real_query($link, 'SELECT "this is sql but with semicolon" AS valid ; '))
- printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ if (false !== ($tmp = mysqli_real_query($link, 'SELECT "this is sql but with backslash
g"\g')))
+ printf("[005] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
- if (!is_object($res = mysqli_use_result($link)))
+ if ((0 === mysqli_errno($link)) || ('' == mysqli_error($link)))
+ printf("[006] mysqli_errno()/mysqli_error should return some error\n");
+
+ if (!mysqli_real_query($link, 'SELECT "this is sql but with semicolon" AS valid ; '))
+ printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+
+ if (!is_object($res = mysqli_use_result($link)))
printf("[008] Expecting reseult object, got %s/%s [%d] %s\n", gettype($res), $res,
mysqli_errno($link), mysqli_error($link));
- var_dump(mysqli_fetch_assoc($res));
- mysqli_free_result($res);
+ var_dump(mysqli_fetch_assoc($res));
+ mysqli_free_result($res);
- if (false !== ($res = mysqli_real_query($link, 'SELECT "this is sql but with
semicolon" AS valid ; SHOW VARIABLES')))
- printf("[008] Expecting boolean/false, got %s/%s, [%d] %s\n", gettype($res),
$res, mysqli_errno($link), mysqli_error($link));
+ if (false !== ($res = mysqli_real_query($link, 'SELECT "this is sql but with semicolon"
AS valid ; SHOW VARIABLES')))
+ printf("[008] Expecting boolean/false, got %s/%s, [%d] %s\n", gettype($res), $res,
+ mysqli_errno($link), mysqli_error($link));
- if (mysqli_get_server_version($link) > 50000) {
- // let's try to play with stored procedures
- mysqli_real_query($link, 'DROP PROCEDURE IF EXISTS p');
- if (mysqli_real_query($link, 'CREATE PROCEDURE p(OUT ver_param VARCHAR(25)) BEGIN
SELECT VERSION() INTO ver_param;
+ if (mysqli_get_server_version($link) > 50000) {
+ // let's try to play with stored procedures
+ mysqli_real_query($link, 'DROP PROCEDURE IF EXISTS p');
+ if (mysqli_real_query($link, 'CREATE PROCEDURE p(OUT ver_param VARCHAR(25)) BEGIN
SELECT VERSION() INTO ver_param;
END;')) {
- mysqli_real_query($link, 'CALL p(@version)');
- mysqli_real_query($link, 'SELECT @version AS p_version');
- $res = mysqli_store_result($link);
-
- $tmp = mysqli_fetch_assoc($res);
- if (!is_array($tmp) || empty($tmp) || !isset($tmp['p_version']) || ('' ==
$tmp['p_version'])) {
- printf("[008a] Expecting array [%d] %s\n", mysqli_errno($link),
mysqli_error($link));
- var_dump($tmp);
- }
-
- mysqli_free_result($res);
- } else {
- printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- }
+ mysqli_real_query($link, 'CALL p(@version)');
+ mysqli_real_query($link, 'SELECT @version AS p_version');
+ $res = mysqli_store_result($link);
- mysqli_real_query($link, 'DROP FUNCTION IF EXISTS f');
- if (mysqli_real_query($link, 'CREATE FUNCTION f( ver_param VARCHAR(25)) RETURNS
VARCHAR(25) DETERMINISTIC RETURN
+ $tmp = mysqli_fetch_assoc($res);
+ if (!is_array($tmp) || empty($tmp) || !isset($tmp['p_version']) || ('' ==
$tmp['p_version'])) {
+ printf("[008a] Expecting array [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ var_dump($tmp);
+ }
+
+ mysqli_free_result($res);
+ } else {
+ printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ }
+ mysqli_real_query($link, 'DROP FUNCTION IF EXISTS f');
+ if (mysqli_real_query($link, 'CREATE FUNCTION f( ver_param VARCHAR(25)) RETURNS
VARCHAR(25) DETERMINISTIC RETURN
ver_param;')) {
- mysqli_real_query($link, 'SELECT f(VERSION()) AS f_version');
- $res = mysqli_store_result($link);
-
- $tmp = mysqli_fetch_assoc($res);
- if (!is_array($tmp) || empty($tmp) || !isset($tmp['f_version']) || ('' ==
$tmp['f_version'])) {
- printf("[009a] Expecting array [%d] %s\n", mysqli_errno($link),
mysqli_error($link));
- var_dump($tmp);
- }
-
- mysqli_free_result($res);
- } else {
- printf("[010] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- }
- }
+ mysqli_real_query($link, 'SELECT f(VERSION()) AS f_version');
+ $res = mysqli_store_result($link);
- mysqli_close($link);
+ $tmp = mysqli_fetch_assoc($res);
+ if (!is_array($tmp) || empty($tmp) || !isset($tmp['f_version']) || ('' ==
$tmp['f_version'])) {
+ printf("[009a] Expecting array [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ var_dump($tmp);
+ }
- if (NULL !== ($tmp = mysqli_real_query($link, "SELECT id FROM test")))
- printf("[011] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+ mysqli_free_result($res);
+ } else {
+ printf("[010] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ }
+ }
- print "done!";
+ mysqli_close($link);
+
+ if (NULL !== ($tmp = mysqli_real_query($link, "SELECT id FROM test")))
+ printf("[011] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+
+ print "done!";
?>
--EXPECTF--
array(1) {
@@ -101,4 +101,4 @@
}
Warning: mysqli_real_query(): Couldn't fetch mysqli in %s on line %d
-done!
+done!
\ No newline at end of file
| Thread |
|---|
| • PHP mysqlnd svn commit: r795 - trunk/tests/ext/mysqli | uwendel | 19 Jul |