]> granicus.if.org Git - php/commitdiff
Connection parameter should be taken from connect.inc and used all in
authorUlf Wendel <uw@php.net>
Thu, 12 Jul 2007 20:53:05 +0000 (20:53 +0000)
committerUlf Wendel <uw@php.net>
Thu, 12 Jul 2007 20:53:05 +0000 (20:53 +0000)
mysqli_connect() and friends. Use UEXPECTF instead of crippled EXPECTF.

ext/mysqli/tests/030.phpt
ext/mysqli/tests/031.phpt
ext/mysqli/tests/032.phpt
ext/mysqli/tests/033.phpt
ext/mysqli/tests/034.phpt
ext/mysqli/tests/035.phpt
ext/mysqli/tests/036.phpt
ext/mysqli/tests/037.phpt
ext/mysqli/tests/038.phpt
ext/mysqli/tests/039.phpt

index a3946c3715fedf35aadbe46e2574b55b0bb3fd78..cd48edc3122d92af0ef0dbaf624b1360b2252452 100644 (file)
@@ -7,19 +7,21 @@ function test: mysqli_errno
        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
index 4e1e35f4eef2564de2d6fb71ac88419d54d50cd5..9ece3830da59706e41f677b110111787cc70bcc7 100644 (file)
@@ -7,19 +7,25 @@ function test: mysqli_error
        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
index f210869b927e4188be70b75416579928a9fce52a..d398b3703f4617bae0ae5b994684188d3c1f6792 100644 (file)
@@ -5,11 +5,11 @@ function test: mysqli_info
 --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 @@ function test: mysqli_info
        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
index de401f49debbd47781514487c40eb956620cb1f7..fff4be4d3a440bbaa6ed3b35901098a7760c87b1 100644 (file)
@@ -6,15 +6,20 @@ function test: mysqli_get_host_info
 --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
index 468861c3c22f179b7e1888b83d8b213f0b524497..a381ecad820289a2276034072486d30b05aab25e 100644 (file)
@@ -6,15 +6,17 @@ function test: mysqli_get_proto_info
 --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
index ea31222ec73ae4668e9d4395100674ed1979843c..0eeb5bfea30c746bb3be80f065730a39d9be7af6 100644 (file)
@@ -5,15 +5,17 @@ function test: mysqli_get_server_info
 --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
index 057795bb4c641acd3493872ea4224582b97834dd..f1a21143529e23b9d68c2d7da52458b4e997a9c5 100644 (file)
@@ -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 @@ function test: mysqli_insert_id()
 <?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 @@ function test: mysqli_insert_id()
 
        /* 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 @@ array(2) {
   [1]=>
   bool(true)
 }
+done!
\ No newline at end of file
index c9089c19be4fe650593ce18a744a1a7e6652e598..f1aa63e84a4457b7a2751744539ccf4f9135ffd7 100644 (file)
@@ -6,11 +6,11 @@ function test: mysqli_field_count()
 <?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 @@ function test: mysqli_field_count()
 
        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 @@ array(2) {
   [1]=>
   int(2)
 }
+done!
\ No newline at end of file
index ecd4f908f11204f1661677f8846678dd074226bc..0e4fb435c9a3e88cab3bcdbf3acd402580781a6f 100644 (file)
@@ -8,9 +8,9 @@ function test: mysqli_num_fields()
        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");
 
index 1d5ab991062e328046ce385c8e8856ad263360af..805b2aadff458ec6227f28744b1986254147ae22 100644 (file)
@@ -6,9 +6,9 @@ function test: mysqli_num_fields() 2
 <?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 @@ function test: mysqli_num_fields() 2
        var_dump($num);
 
        mysqli_close($link);
+       print "done!";
 ?>
 --EXPECT--
 int(2)
+done!
\ No newline at end of file