uw Thu Jul 12 20:53:05 2007 UTC
Modified files:
/php-src/ext/mysqli/tests 030.phpt 031.phpt 032.phpt 033.phpt
034.phpt 035.phpt 036.phpt 037.phpt
038.phpt 039.phpt
Log:
Connection parameter should be taken from connect.inc and used all in
mysqli_connect() and friends. Use UEXPECTF instead of crippled EXPECTF.
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/030.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/mysqli/tests/030.phpt
diff -u php-src/ext/mysqli/tests/030.phpt:1.3
php-src/ext/mysqli/tests/030.phpt:1.4
--- php-src/ext/mysqli/tests/030.phpt:1.3 Sat Dec 4 08:50:33 2004
+++ php-src/ext/mysqli/tests/030.phpt Thu Jul 12 20:53:05 2007
@@ -7,19 +7,21 @@
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$errno = mysqli_errno($link);
var_dump($errno);
mysqli_select_db($link, "test");
mysqli_query($link, "select * from non_exisiting_table");
- $errno = mysqli_errno($link);
+ $errno = mysqli_errno($link);
var_dump($errno);
mysqli_close($link);
+ print "done!";
?>
--EXPECT--
int(0)
int(1146)
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/031.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/mysqli/tests/031.phpt
diff -u php-src/ext/mysqli/tests/031.phpt:1.4
php-src/ext/mysqli/tests/031.phpt:1.5
--- php-src/ext/mysqli/tests/031.phpt:1.4 Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/031.phpt Thu Jul 12 20:53:05 2007
@@ -7,19 +7,25 @@
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$error = mysqli_error($link);
var_dump($error);
- mysqli_select_db($link, "test");
+ mysqli_select_db($link, $db);
mysqli_query($link, "select * from non_exisiting_table");
- $error = mysqli_error($link);
+ $error = mysqli_error($link);
var_dump($error);
mysqli_close($link);
+ print "done!";
?>
--EXPECTF--
-%s(0) ""
-%s(46) "Table 'test.non_exisiting_table' doesn't exist"
+string(0) ""
+string(%d) "%s"
+done!
+--UEXPECTF--
+unicode(0) ""
+unicode(%d) "%s"
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/032.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/mysqli/tests/032.phpt
diff -u php-src/ext/mysqli/tests/032.phpt:1.4
php-src/ext/mysqli/tests/032.phpt:1.5
--- php-src/ext/mysqli/tests/032.phpt:1.4 Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/032.phpt Thu Jul 12 20:53:05 2007
@@ -5,11 +5,11 @@
--FILE--
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
- mysqli_select_db($link, "test");
+ mysqli_select_db($link, $db);
mysqli_query($link, "drop table if exists general_test");
mysqli_query($link, "create table general_test (a int)");
@@ -20,6 +20,11 @@
var_dump($afc);
mysqli_close($link);
+ print "done!";
?>
--EXPECTF--
-%s(38) "Records: 3 Duplicates: 0 Warnings: 0"
+string(38) "Records: 3 Duplicates: 0 Warnings: 0"
+done!
+--UEXPECTF--
+unicode(38) "Records: 3 Duplicates: 0 Warnings: 0"
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/033.phpt?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/mysqli/tests/033.phpt
diff -u php-src/ext/mysqli/tests/033.phpt:1.5
php-src/ext/mysqli/tests/033.phpt:1.6
--- php-src/ext/mysqli/tests/033.phpt:1.5 Tue Apr 19 15:45:07 2005
+++ php-src/ext/mysqli/tests/033.phpt Thu Jul 12 20:53:05 2007
@@ -6,15 +6,20 @@
--FILE--
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$hinfo = mysqli_get_host_info($link);
var_dump(str_replace('/','', $hinfo));
mysqli_close($link);
+ print "done!";
?>
--EXPECTF--
string(%d) "%s via %s"
+done!
+--UEXPECTF--
+unicode(%d) "%s via %s"
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/034.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/mysqli/tests/034.phpt
diff -u php-src/ext/mysqli/tests/034.phpt:1.4
php-src/ext/mysqli/tests/034.phpt:1.5
--- php-src/ext/mysqli/tests/034.phpt:1.4 Fri Jan 7 14:59:59 2005
+++ php-src/ext/mysqli/tests/034.phpt Thu Jul 12 20:53:05 2007
@@ -6,15 +6,17 @@
--FILE--
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$pinfo = mysqli_get_proto_info($link);
var_dump($pinfo);
mysqli_close($link);
+ print "done!";
?>
--EXPECT--
int(10)
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/035.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/mysqli/tests/035.phpt
diff -u php-src/ext/mysqli/tests/035.phpt:1.4
php-src/ext/mysqli/tests/035.phpt:1.5
--- php-src/ext/mysqli/tests/035.phpt:1.4 Sat Dec 4 08:50:33 2004
+++ php-src/ext/mysqli/tests/035.phpt Thu Jul 12 20:53:05 2007
@@ -5,15 +5,17 @@
--FILE--
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$sinfo = substr(mysqli_get_server_info($link),0,1);
var_dump(strlen($sinfo));
mysqli_close($link);
+ print "done!";
?>
--EXPECT--
int(1)
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/036.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/mysqli/tests/036.phpt
diff -u php-src/ext/mysqli/tests/036.phpt:1.4
php-src/ext/mysqli/tests/036.phpt:1.5
--- php-src/ext/mysqli/tests/036.phpt:1.4 Wed Jul 20 00:18:24 2005
+++ php-src/ext/mysqli/tests/036.phpt Thu Jul 12 20:53:05 2007
@@ -1,7 +1,7 @@
--TEST--
function test: mysqli_insert_id()
--SKIPIF--
-<?php
+<?php
if (PHP_INT_SIZE == 8) {
echo 'skip test valid only for 32bit systems';
exit;
@@ -12,11 +12,11 @@
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
- mysqli_select_db($link, "test");
+ mysqli_select_db($link, $db);
mysqli_query($link, "DROP TABLE IF EXISTS t036");
@@ -28,19 +28,20 @@
/* we have to insert more values, cause lexer sets auto_increment to
max_int
see mysql bug #54. So we don't check for the value, only for type
(which must
- be type string)
- */
-
+ be type string)
+ */
+
mysqli_query($link, "ALTER TABLE t036 AUTO_INCREMENT=9999999999999998");
mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo2')");
mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo3')");
mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo4')");
$x = mysqli_insert_id($link);
$test[] = is_string($x);
-
+
var_dump($test);
mysqli_close($link);
+ print "done!";
?>
--EXPECT--
array(2) {
@@ -49,3 +50,4 @@
[1]=>
bool(true)
}
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/037.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/mysqli/tests/037.phpt
diff -u php-src/ext/mysqli/tests/037.phpt:1.3
php-src/ext/mysqli/tests/037.phpt:1.4
--- php-src/ext/mysqli/tests/037.phpt:1.3 Sat Dec 4 08:50:33 2004
+++ php-src/ext/mysqli/tests/037.phpt Thu Jul 12 20:53:05 2007
@@ -6,11 +6,11 @@
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
- mysqli_select_db($link, "test");
+ mysqli_select_db($link, $db);
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
@@ -21,11 +21,12 @@
mysqli_real_query($link, "SELECT * FROM test_result");
$ir[] = mysqli_field_count($link);
-
-
+
+
var_dump($ir);
mysqli_close($link);
+ print "done!";
?>
--EXPECT--
array(2) {
@@ -34,3 +35,4 @@
[1]=>
int(2)
}
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/038.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/mysqli/tests/038.phpt
diff -u php-src/ext/mysqli/tests/038.phpt:1.3
php-src/ext/mysqli/tests/038.phpt:1.4
--- php-src/ext/mysqli/tests/038.phpt:1.3 Sat Dec 4 08:50:33 2004
+++ php-src/ext/mysqli/tests/038.phpt Thu Jul 12 20:53:05 2007
@@ -8,9 +8,9 @@
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
- mysqli_select_db($link, "test");
+ mysqli_select_db($link, $db);
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/039.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/mysqli/tests/039.phpt
diff -u php-src/ext/mysqli/tests/039.phpt:1.3
php-src/ext/mysqli/tests/039.phpt:1.4
--- php-src/ext/mysqli/tests/039.phpt:1.3 Sat Dec 4 08:50:33 2004
+++ php-src/ext/mysqli/tests/039.phpt Thu Jul 12 20:53:05 2007
@@ -6,9 +6,9 @@
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_real_query($link, "SHOW VARIABLES");
@@ -21,6 +21,8 @@
var_dump($num);
mysqli_close($link);
+ print "done!";
?>
--EXPECT--
int(2)
+done!
\ No newline at end of file
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php