]> granicus.if.org Git - php/commitdiff
As usual:
authorUlf Wendel <uw@php.net>
Thu, 12 Jul 2007 20:55:12 +0000 (20:55 +0000)
committerUlf Wendel <uw@php.net>
Thu, 12 Jul 2007 20:55:12 +0000 (20:55 +0000)
 - connection parameter tweaking
 - a bit of whitespace here and there
 - use UEXPECTF if need be

ext/mysqli/tests/040.phpt
ext/mysqli/tests/041.phpt
ext/mysqli/tests/042.phpt
ext/mysqli/tests/043.phpt
ext/mysqli/tests/044.phpt
ext/mysqli/tests/045.phpt
ext/mysqli/tests/046.phpt
ext/mysqli/tests/047.phpt
ext/mysqli/tests/048.phpt
ext/mysqli/tests/049.phpt

index 79bfe0d5fb4859aaacf0f374c73053fc89a85e8f..18a42185f39f1b4e08a4ce9db96a79f3313c0fbf 100644 (file)
@@ -6,11 +6,11 @@ function test: mysqli_num_rows()
 <?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");
 
@@ -28,6 +28,8 @@ function test: mysqli_num_rows()
        var_dump($num);
 
        mysqli_close($link);
+       print "done!";
 ?>
 --EXPECT--
 int(1)
+done!
\ No newline at end of file
index 90bed1ad49ad86521256f65de484faf3f900528f..7b750d6ecc7853a5bb0350f1769c1ceb22943f30 100644 (file)
@@ -6,10 +6,10 @@ function test: mysqli_warning_count()
 <?php
 
        include "connect.inc";
-       
+
        /*** test mysqli_connect 127.0.0.1 ***/
-       $link = mysqli_connect($host, $user, $passwd);
-       mysqli_select_db($link, "test");
+       $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
+       mysqli_select_db($link, $db);
 
        mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
        mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
@@ -17,6 +17,8 @@ function test: mysqli_warning_count()
        var_dump(mysqli_warning_count($link));
 
        mysqli_close($link);
+       print "done!";
 ?>
 --EXPECT--
 int(1)
+done!
\ No newline at end of file
index 181461af848eb84b26a427fef247cbcd63acae56..acc262992a0e58df046d46ac41b260ba131dcccb 100644 (file)
@@ -5,15 +5,15 @@ mysqli_fetch_object
 --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, "SET sql_mode=''");
 
-       mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
-       mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
+       mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
+       mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
                                                      c2 smallint unsigned,
                                                      c3 smallint,
                                                      c4 smallint,
@@ -42,6 +42,7 @@ mysqli_fetch_object
        var_dump($test);
 
        mysqli_close($link);
+       print "done!"
 ?>
 --EXPECTF--
 object(stdClass)#%d (7) {
@@ -60,6 +61,7 @@ object(stdClass)#%d (7) {
   ["c7"]=>
   string(1) "0"
 }
+done!
 --UEXPECTF--
 object(stdClass)#%d (7) {
   [u"c1"]=>
@@ -77,3 +79,4 @@ object(stdClass)#%d (7) {
   [u"c7"]=>
   unicode(1) "0"
 }
+done!
\ No newline at end of file
index d218d8f8689eff9c7dffdfb0d4774f6157757687..20fb52a9e7529f02811b6e386a7bb60c79756026 100644 (file)
@@ -5,14 +5,14 @@ mysqli_bind_param (UPDATE)
 --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 test_update");
-       mysqli_query($link,"CREATE TABLE test_update(a varchar(10),
+       mysqli_query($link,"DROP TABLE IF EXISTS test_update");
+       mysqli_query($link,"CREATE TABLE test_update(a varchar(10),
                                                      b int)");
 
        mysqli_query($link, "INSERT INTO test_update VALUES ('foo', 2)");
@@ -34,9 +34,17 @@ mysqli_bind_param (UPDATE)
        var_dump($test);
 
        mysqli_close($link);
+       print "done!";
 ?>
 --EXPECTF--
 array(1) {
   [0]=>
-  %s(15) "Rasmus is No. 1"
+  string(15) "Rasmus is No. 1"
+}
+done!
+--UEXPECF--
+array(1) {
+  [0]=>
+  unicode(15) "Rasmus is No. 1"
 }
+done!
\ No newline at end of file
index 28e73a7e0999b68043f61aafab6523920ddf4230..9a5069ec80ae83e23dd48f8c2db3937c96779e23 100644 (file)
@@ -5,9 +5,9 @@ mysqli_get_server_version
 --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);
 
        $i = mysqli_get_server_version($link);
 
@@ -16,6 +16,8 @@ mysqli_get_server_version
        var_dump($test);
 
        mysqli_close($link);
+       print "done!";
 ?>
 --EXPECT--
 int(1)
+done!
\ No newline at end of file
index abb64048507f0b1cab4ce65516dfbf951bcc29dd..36bb92a525a679eb4dd2d59dab5420d5c4922929 100644 (file)
@@ -1,9 +1,9 @@
 --TEST--
 mysqli_bind_result (SHOW)
 --SKIPIF--
-<?php  
+<?php
        require_once('skipif.inc');
-       require_once('skipifemb.inc'); 
+       require_once('skipifemb.inc');
 
        include "connect.inc";
        $link = mysqli_connect($host, $user, $passwd);
@@ -21,26 +21,36 @@ mysqli_bind_result (SHOW)
 --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);
 
        $stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
        mysqli_execute($stmt);
 
-       mysqli_bind_result($stmt, $c1, $c2);    
+       mysqli_bind_result($stmt, $c1, $c2);
        mysqli_fetch($stmt);
-       mysqli_stmt_close($stmt);       
+       mysqli_stmt_close($stmt);
        $test = array ($c1,$c2);
 
        var_dump($test);
 
        mysqli_close($link);
+       print "done!";
 ?>
 --EXPECTF--
 array(2) {
   [0]=>
-  %s(4) "port"
+  string(4) "port"
+  [1]=>
+  string(%d) "%s"
+}
+done!
+--UEXPECTF--
+array(2) {
+  [0]=>
+  unicode(4) "port"
   [1]=>
-  %s(4) "%s"
+  unicode(%d) "%s"
 }
+done!
\ No newline at end of file
index e88348bfa92599457a7e8d5d145175269948b250..7916c24d30e63505cdbe0e490e0021ed0c4c095f 100644 (file)
@@ -5,11 +5,11 @@ mysqli_stmt_affected_rows (delete)
 --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 test_affected");
        mysqli_query($link, "CREATE TABLE test_affected (foo int)");
@@ -24,10 +24,12 @@ mysqli_stmt_affected_rows (delete)
        mysqli_execute($stmt);
        $x = mysqli_stmt_affected_rows($stmt);
 
-       mysqli_stmt_close($stmt);       
+       mysqli_stmt_close($stmt);
        var_dump($x==1);
 
        mysqli_close($link);
+       print "done!";
 ?>
 --EXPECT--
 bool(true)
+done!
\ No newline at end of file
index d2bcda40d27cf0e324cffed690ebbe95dbae662f..3715ba2b051097738d937ac3c3fc95f37e37297d 100644 (file)
@@ -5,11 +5,11 @@ mysqli_get_metadata
 --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 test_affected");
        mysqli_query($link, "CREATE TABLE test_affected (foo int, bar varchar(10) character set latin1)");
@@ -31,14 +31,15 @@ mysqli_get_metadata
        while ($field = mysqli_fetch_field($result)) {
                var_dump($field);
        }
-    
+
        print_r(mysqli_fetch_lengths($result));
-    
+
        mysqli_free_result($result);
 
 
-       mysqli_stmt_close($stmt);       
+       mysqli_stmt_close($stmt);
        mysqli_close($link);
+       print "done!";
 ?>
 --EXPECTF--
 === fetch_fields ===
@@ -194,6 +195,7 @@ object(stdClass)#5 (11) {
   ["decimals"]=>
   int(0)
 }
+done!
 --UEXPECTF--
 === fetch_fields ===
 array(2) {
@@ -348,3 +350,4 @@ object(stdClass)#5 (11) {
   [u"decimals"]=>
   int(0)
 }
+done!
\ No newline at end of file
index cf4eab9fe3a3a78d1ab1e2b70d204415785f65f5..d713947763a4777609ce99f8e6524f166cd12ea7 100644 (file)
@@ -1,29 +1,29 @@
 --TEST--
-mysqli bind_result (OO-Style) 
+mysqli bind_result (OO-Style)
 --SKIPIF--
 <?php require_once('skipif.inc'); ?>
 --FILE--
 <?php
        include "connect.inc";
-       
+
        /*** test mysqli_connect 127.0.0.1 ***/
-       $mysql = mysqli_connect($host, $user, $passwd);
+       $mysql = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-       $mysql->select_db("test");              
+       $mysql->select_db($db);
        $mysql->query("DROP TABLE IF EXISTS test_fetch_null");
 
        $mysql->query("CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint,
-                                                       col3 int, col4 bigint, 
+                                                       col3 int, col4 bigint,
                                                        col5 float, col6 double,
-                                                       col7 date, col8 time, 
-                                                       col9 varbinary(10), 
+                                                       col7 date, col8 time,
+                                                       col9 varbinary(10),
                                                        col10 varchar(50),
                                                        col11 char(20))");
-  
+
        $mysql->query("INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)");
 
        $stmt = $mysql->prepare("SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null");
-       $stmt->bind_result($c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11); 
+       $stmt->bind_result($c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
        $stmt->execute();
 
        $stmt->fetch();
@@ -34,6 +34,7 @@ mysqli bind_result (OO-Style)
 
        $stmt->close();
        $mysql->close();
+       print "done!";
 ?>
 --EXPECTF--
 array(11) {
@@ -56,7 +57,34 @@ array(11) {
   [8]=>
   NULL
   [9]=>
-  %s(4) "foo1"
+  string(4) "foo1"
+  [10]=>
+  string(4) "1000"
+}
+done!
+--UEXPECTF--
+array(11) {
+  [0]=>
+  int(1)
+  [1]=>
+  NULL
+  [2]=>
+  NULL
+  [3]=>
+  NULL
+  [4]=>
+  NULL
+  [5]=>
+  NULL
+  [6]=>
+  NULL
+  [7]=>
+  NULL
+  [8]=>
+  NULL
+  [9]=>
+  unicode(4) "foo1"
   [10]=>
-  %s(4) "1000"
+  unicode(4) "1000"
 }
+done!
\ No newline at end of file
index 5e82040ffcf1351cbcd71290ce9f0d282fb30aab..8e458b386f1432e98d0c9552da18353b046f4c59 100644 (file)
@@ -1,16 +1,16 @@
 --TEST--
-mysql_fetch_row (OO-Style) 
+mysql_fetch_row (OO-Style)
 --SKIPIF--
 <?php require_once('skipif.inc'); ?>
 <?php require_once('skipifemb.inc'); ?>
 --FILE--
 <?php
        include "connect.inc";
-       
+
        /*** test mysqli_connect 127.0.0.1 ***/
-       $mysql = mysqli_connect($host, $user, $passwd);
+       $mysql = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-       $mysql->select_db("test");              
+       $mysql->select_db($db);
        $result = $mysql->query("SELECT DATABASE()");
        $row = $result->fetch_row();
        $result->close();
@@ -18,9 +18,17 @@ mysql_fetch_row (OO-Style)
        var_dump($row);
 
        $mysql->close();
+       print "done!";
 ?>
 --EXPECTF--
 array(1) {
   [0]=>
-  %s(4) "test"
+  string(%d) "%s"
+}
+done!
+--UEXPECTF--
+array(1) {
+  [0]=>
+  unicode(%d) "%s"
 }
+done!
\ No newline at end of file