uw              Thu Jul 12 20:57:31 2007 UTC

  Modified files:              
    /php-src/ext/mysqli/tests   050.phpt 051.phpt 052.phpt 053.phpt 
                                054.phpt 055.phpt 056.phpt 057.phpt 
                                058.phpt 059.phpt 
  Log:
  Will this never end?
     - connection parameter tweaking
     - a bit of whitespace here and there
     - use UEXPECTF if need be
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/050.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/mysqli/tests/050.phpt
diff -u php-src/ext/mysqli/tests/050.phpt:1.3 
php-src/ext/mysqli/tests/050.phpt:1.4
--- php-src/ext/mysqli/tests/050.phpt:1.3       Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/050.phpt   Thu Jul 12 20:57:30 2007
@@ -1,15 +1,15 @@
 --TEST--
-non freed statement test 
+non freed statement test
 --SKIPIF--
 <?php require_once('skipif.inc'); ?>
 --FILE--
 <?php
        include "connect.inc";
-       
+
        /************************
         * non freed stamement
         ************************/
-       $link = mysqli_connect($host, $user, $passwd);
+       $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
        $stmt = mysqli_prepare($link, "SELECT CURRENT_USER()");
        mysqli_execute($stmt);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/051.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/mysqli/tests/051.phpt
diff -u php-src/ext/mysqli/tests/051.phpt:1.4 
php-src/ext/mysqli/tests/051.phpt:1.5
--- php-src/ext/mysqli/tests/051.phpt:1.4       Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/051.phpt   Thu Jul 12 20:57:30 2007
@@ -1,15 +1,15 @@
 --TEST--
-free statement after close 
+free statement after close
 --SKIPIF--
 <?php require_once('skipif.inc'); ?>
 --FILE--
 <?php
        include "connect.inc";
-       
+
        /************************
-        * free statement after close 
+        * free statement after close
         ************************/
-       $link = mysqli_connect($host, $user, $passwd);
+       $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
        $stmt1 = mysqli_prepare($link, "SELECT CURRENT_USER()");
        mysqli_execute($stmt1);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/052.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/mysqli/tests/052.phpt
diff -u php-src/ext/mysqli/tests/052.phpt:1.4 
php-src/ext/mysqli/tests/052.phpt:1.5
--- php-src/ext/mysqli/tests/052.phpt:1.4       Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/052.phpt   Thu Jul 12 20:57:30 2007
@@ -9,7 +9,7 @@
        /************************
         * statement call  after close 
         ************************/
-       $link = mysqli_connect($host, $user, $passwd);
+       $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
        $stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
 
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/053.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/mysqli/tests/053.phpt
diff -u php-src/ext/mysqli/tests/053.phpt:1.3 
php-src/ext/mysqli/tests/053.phpt:1.4
--- php-src/ext/mysqli/tests/053.phpt:1.3       Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/053.phpt   Thu Jul 12 20:57:30 2007
@@ -9,7 +9,7 @@
        /************************
         * non freed resultset 
         ************************/
-       $link = mysqli_connect($host, $user, $passwd);
+       $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
        $result = mysqli_query($link, "SELECT CURRENT_USER()");
        mysqli_close($link);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/054.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/mysqli/tests/054.phpt
diff -u php-src/ext/mysqli/tests/054.phpt:1.3 
php-src/ext/mysqli/tests/054.phpt:1.4
--- php-src/ext/mysqli/tests/054.phpt:1.3       Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/054.phpt   Thu Jul 12 20:57:30 2007
@@ -9,7 +9,7 @@
        /************************
         * free resultset after close 
         ************************/
-       $link = mysqli_connect($host, $user, $passwd);
+       $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
        $result1 = mysqli_query($link, "SELECT CURRENT_USER()");
        mysqli_close($link);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/055.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/mysqli/tests/055.phpt
diff -u php-src/ext/mysqli/tests/055.phpt:1.3 
php-src/ext/mysqli/tests/055.phpt:1.4
--- php-src/ext/mysqli/tests/055.phpt:1.3       Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/055.phpt   Thu Jul 12 20:57:30 2007
@@ -9,7 +9,7 @@
        /************************
         * don't free anything 
         ************************/
-       $link = mysqli_connect($host, $user, $passwd);
+       $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
        $result2 = mysqli_query($link, "SELECT CURRENT_USER()");
        $stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/056.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/mysqli/tests/056.phpt
diff -u php-src/ext/mysqli/tests/056.phpt:1.3 
php-src/ext/mysqli/tests/056.phpt:1.4
--- php-src/ext/mysqli/tests/056.phpt:1.3       Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/056.phpt   Thu Jul 12 20:57:30 2007
@@ -13,7 +13,7 @@
        }
 
        $foo = new foobar();
-       $foo->connect($host, $user, $passwd);
+       $foo->connect($host, $user, $passwd, $db, $port, $socket);
        $foo->close();
        printf("%s\n", $foo->test());
 ?>
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/057.phpt?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/mysqli/tests/057.phpt
diff -u php-src/ext/mysqli/tests/057.phpt:1.5 
php-src/ext/mysqli/tests/057.phpt:1.6
--- php-src/ext/mysqli/tests/057.phpt:1.5       Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/057.phpt   Thu Jul 12 20:57:30 2007
@@ -5,14 +5,14 @@
 --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_store_result");
-       mysqli_query($link,"CREATE TABLE test_store_result (a int)");
+       mysqli_query($link,"DROP TABLE IF EXISTS test_store_result");
+       mysqli_query($link,"CREATE TABLE test_store_result (a int)");
 
        mysqli_query($link, "INSERT INTO test_store_result VALUES (1),(2),(3)");
 
@@ -26,6 +26,15 @@
        }
        mysqli_stmt_close($stmt);
 
+       /* now we should try mysqli_stmt_reset() */
+       $stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
+       var_dump(mysqli_execute($stmt));
+       var_dump(mysqli_stmt_reset($stmt));
+       var_dump($stmt = mysqli_prepare($link, "SELECT * FROM 
test_store_result"));
+       var_dump(mysqli_execute($stmt));
+       var_dump($stmt = @mysqli_prepare($link, "SELECT * FROM 
test_store_result"), mysqli_error($link));
+       var_dump(mysqli_stmt_reset($stmt));
+
        $stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
        mysqli_execute($stmt);
        $result1 = mysqli_get_metadata($stmt);
@@ -37,18 +46,46 @@
        if ($result = mysqli_query($link, "SELECT * FROM test_store_result")) {
                $row = mysqli_fetch_row($result);
                mysqli_free_result($result);
-       } 
-       
+       }
 
-       var_dump($row); 
+       var_dump($row);
 
        mysqli_free_result($result1);
        mysqli_stmt_close($stmt);
        mysqli_close($link);
+       echo "done!";
 ?>
 --EXPECTF--
+bool(true)
+bool(true)
+object(mysqli_stmt)#%d (%d) {
+}
+bool(true)
+bool(false)
+string(0) ""
+
+Warning: mysqli_stmt_reset() expects parameter 1 to be mysqli_stmt, boolean 
given in %s on line %d
+NULL
+Rows: 3
+array(1) {
+  [0]=>
+  string(1) "1"
+}
+done!
+--UEXPECTF--
+bool(true)
+bool(true)
+object(mysqli_stmt)#%d (%d) {
+}
+bool(true)
+bool(false)
+unicode(0) ""
+
+Warning: mysqli_stmt_reset() expects parameter 1 to be mysqli_stmt, boolean 
given in %s on line %d
+NULL
 Rows: 3
 array(1) {
   [0]=>
-  %s(1) "1"
+  unicode(1) "1"
 }
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/058.phpt?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/mysqli/tests/058.phpt
diff -u php-src/ext/mysqli/tests/058.phpt:1.5 
php-src/ext/mysqli/tests/058.phpt:1.6
--- php-src/ext/mysqli/tests/058.phpt:1.5       Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/058.phpt   Thu Jul 12 20:57:30 2007
@@ -5,17 +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);
 
-       mysqli_select_db($link, "test");
+       mysqli_select_db($link, $db);
 
-       mysqli_query($link,"DROP TABLE IF EXISTS mbind");
-       mysqli_query($link,"CREATE TABLE mbind (a int, b varchar(10))");
+       mysqli_query($link,"DROP TABLE IF EXISTS mbind");
+       mysqli_query($link,"CREATE TABLE mbind (a int, b varchar(10))");
 
        $stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?,?)");
-       
+
        mysqli_bind_param($stmt, "is", $a, $b);
 
        $a = 1;
@@ -43,15 +43,29 @@
        var_dump((array($e,$f,$g,$h)));
 
        mysqli_close($link);
+       print "done!";
 ?>
 --EXPECTF--
 array(4) {
   [0]=>
   int(1)
   [1]=>
-  %s(3) "foo"
+  string(3) "foo"
+  [2]=>
+  int(2)
+  [3]=>
+  string(3) "bar"
+}
+done!
+--UEXPECTF--
+array(4) {
+  [0]=>
+  int(1)
+  [1]=>
+  unicode(3) "foo"
   [2]=>
   int(2)
   [3]=>
-  %s(3) "bar"
+  unicode(3) "bar"
 }
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/059.phpt?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/mysqli/tests/059.phpt
diff -u php-src/ext/mysqli/tests/059.phpt:1.5 
php-src/ext/mysqli/tests/059.phpt:1.6
--- php-src/ext/mysqli/tests/059.phpt:1.5       Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/059.phpt   Thu Jul 12 20:57:30 2007
@@ -5,19 +5,19 @@
 --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='PIPES_AS_CONCAT'");
 
-       mysqli_query($link,"DROP TABLE IF EXISTS mbind");
-       mysqli_query($link,"CREATE TABLE mbind (b varchar(25))");
+       mysqli_query($link,"DROP TABLE IF EXISTS mbind");
+       mysqli_query($link,"CREATE TABLE mbind (b varchar(25))");
 
        $stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?||?)");
-       
+
        mysqli_bind_param($stmt, "ss", $a, $b);
 
        $a = "foo";
@@ -36,8 +36,11 @@
        var_dump($e);
 
        mysqli_close($link);
+       print "done!";
 ?>
 --EXPECT--
 string(6) "foobar"
+done!
 --UEXPECT--
 unicode(6) "foobar"
+done!
\ No newline at end of file

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to