summaryrefslogtreecommitdiff
path: root/ext/mysqli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/tests')
-rw-r--r--ext/mysqli/tests/001.phpt25
-rw-r--r--ext/mysqli/tests/002.phpt2
-rw-r--r--ext/mysqli/tests/003.phpt2
-rw-r--r--ext/mysqli/tests/004.phpt2
-rw-r--r--ext/mysqli/tests/005.phpt2
-rw-r--r--ext/mysqli/tests/006.phpt2
-rw-r--r--ext/mysqli/tests/007.phpt2
-rw-r--r--ext/mysqli/tests/008.phpt2
-rw-r--r--ext/mysqli/tests/009.phpt2
-rw-r--r--ext/mysqli/tests/010.phpt2
-rw-r--r--ext/mysqli/tests/011.phpt2
-rw-r--r--ext/mysqli/tests/012.phpt2
-rw-r--r--ext/mysqli/tests/013.phpt2
-rw-r--r--ext/mysqli/tests/014.phpt4
-rw-r--r--ext/mysqli/tests/015.phpt4
-rw-r--r--ext/mysqli/tests/016.phpt2
-rw-r--r--ext/mysqli/tests/017.phpt8
-rw-r--r--ext/mysqli/tests/018.phpt2
-rw-r--r--ext/mysqli/tests/019.phpt2
-rw-r--r--ext/mysqli/tests/020.phpt2
-rw-r--r--ext/mysqli/tests/021.phpt2
-rw-r--r--ext/mysqli/tests/022.phpt2
-rw-r--r--ext/mysqli/tests/023.phpt2
-rw-r--r--ext/mysqli/tests/024.phpt2
-rw-r--r--ext/mysqli/tests/025.phpt2
-rw-r--r--ext/mysqli/tests/026.phpt6
-rw-r--r--ext/mysqli/tests/027.phpt6
-rw-r--r--ext/mysqli/tests/028.phpt6
-rw-r--r--ext/mysqli/tests/029.phpt6
-rw-r--r--ext/mysqli/tests/030.phpt5
-rw-r--r--ext/mysqli/tests/031.phpt5
-rw-r--r--ext/mysqli/tests/032.phpt6
-rw-r--r--ext/mysqli/tests/033.phpt6
-rw-r--r--ext/mysqli/tests/034.phpt6
-rw-r--r--ext/mysqli/tests/035.phpt6
-rw-r--r--ext/mysqli/tests/036.phpt2
-rw-r--r--ext/mysqli/tests/037.phpt2
-rw-r--r--ext/mysqli/tests/038.phpt2
-rw-r--r--ext/mysqli/tests/039.phpt2
-rw-r--r--ext/mysqli/tests/040.phpt2
-rw-r--r--ext/mysqli/tests/041.phpt2
-rw-r--r--ext/mysqli/tests/042.phpt2
-rw-r--r--ext/mysqli/tests/043.phpt2
-rw-r--r--ext/mysqli/tests/044.phpt2
-rw-r--r--ext/mysqli/tests/045.phpt4
-rw-r--r--ext/mysqli/tests/046.phpt2
-rw-r--r--ext/mysqli/tests/047.phpt2
-rw-r--r--ext/mysqli/tests/048.phpt2
-rw-r--r--ext/mysqli/tests/049.phpt12
-rw-r--r--ext/mysqli/tests/050.phpt2
-rw-r--r--ext/mysqli/tests/051.phpt2
-rw-r--r--ext/mysqli/tests/052.phpt2
-rw-r--r--ext/mysqli/tests/053.phpt2
-rw-r--r--ext/mysqli/tests/054.phpt2
-rw-r--r--ext/mysqli/tests/055.phpt2
-rw-r--r--ext/mysqli/tests/056.phpt2
-rw-r--r--ext/mysqli/tests/057.phpt2
-rw-r--r--ext/mysqli/tests/058.phpt2
-rw-r--r--ext/mysqli/tests/059.phpt2
-rw-r--r--ext/mysqli/tests/060.phpt2
-rw-r--r--ext/mysqli/tests/061.phpt2
-rw-r--r--ext/mysqli/tests/bug28817.phpt37
-rw-r--r--ext/mysqli/tests/bug29311.phpt8
-rw-r--r--ext/mysqli/tests/bug30967.phpt2
64 files changed, 131 insertions, 121 deletions
diff --git a/ext/mysqli/tests/001.phpt b/ext/mysqli/tests/001.phpt
index 5e483aba8d..8c9dc41f31 100644
--- a/ext/mysqli/tests/001.phpt
+++ b/ext/mysqli/tests/001.phpt
@@ -2,48 +2,37 @@
mysqli connect
--FILE--
<?php
+ include "connect.inc";
- $user = "root";
- $passwd = "";
$dbname = "test";
$test = "";
- /*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("127.0.0.1", $user, $passwd);
- $test .= ($link) ? "1" : "0";
- mysqli_close($link);
-
- /*** test mysqli_connect localhost ***/
- $link = mysqli_connect("localhost", $user, $passwd);
- $test .= ($link) ? "1" : "0";
- mysqli_close($link);
-
/*** test mysqli_connect localhost:port ***/
- $link = mysqli_connect("localhost", $user, $passwd, "", 3306);
+ $link = mysqli_connect($host, $user, $passwd, "", 3306);
$test .= ($link) ? "1" : "0";
mysqli_close($link);
/*** test mysqli_real_connect ***/
$link = mysqli_init();
- $test.= (mysqli_real_connect($link, "localhost", $user, $passwd))
+ $test.= (mysqli_real_connect($link, $host, $user, $passwd))
? "1" : "0";
mysqli_close($link);
/*** test mysqli_real_connect with db ***/
$link = mysqli_init();
- $test .= (mysqli_real_connect($link, "localhost", $user, $passwd, $dbname))
+ $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname))
? "1" : "0";
mysqli_close($link);
/*** test mysqli_real_connect with port ***/
$link = mysqli_init();
- $test .= (mysqli_real_connect($link, "localhost", $user, $passwd, $dbname, 3306))
+ $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname, 3306))
? "1":"0";
mysqli_close($link);
/*** test mysqli_real_connect compressed ***/
$link = mysqli_init();
- $test .= (mysqli_real_connect($link, "localhost", $user, $passwd, $dbname, 0, NULL, MYSQLI_CLIENT_COMPRESS))
+ $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname, 0, NULL, MYSQLI_CLIENT_COMPRESS))
? "1" : "0";
mysqli_close($link);
@@ -52,4 +41,4 @@ mysqli connect
var_dump($test);
?>
--EXPECT--
-string(7) "1111111"
+string(5) "11111"
diff --git a/ext/mysqli/tests/002.phpt b/ext/mysqli/tests/002.phpt
index 7925f84fa8..255944a4ec 100644
--- a/ext/mysqli/tests/002.phpt
+++ b/ext/mysqli/tests/002.phpt
@@ -5,7 +5,7 @@ mysqli bind_result 1
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
$rc = mysqli_query($link,"DROP TABLE IF EXISTS test_fetch_null");
diff --git a/ext/mysqli/tests/003.phpt b/ext/mysqli/tests/003.phpt
index 906bf28dec..0500ec5577 100644
--- a/ext/mysqli/tests/003.phpt
+++ b/ext/mysqli/tests/003.phpt
@@ -5,7 +5,7 @@ mysqli connect
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/004.phpt b/ext/mysqli/tests/004.phpt
index 179c4b64cf..33815c2f76 100644
--- a/ext/mysqli/tests/004.phpt
+++ b/ext/mysqli/tests/004.phpt
@@ -5,7 +5,7 @@ mysqli fetch char/text
include ("connect.inc");
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/005.phpt b/ext/mysqli/tests/005.phpt
index 982a3950f2..48a0d77983 100644
--- a/ext/mysqli/tests/005.phpt
+++ b/ext/mysqli/tests/005.phpt
@@ -5,7 +5,7 @@ mysqli fetch char/text long
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/006.phpt b/ext/mysqli/tests/006.phpt
index d697e1e82f..87fbc609e5 100644
--- a/ext/mysqli/tests/006.phpt
+++ b/ext/mysqli/tests/006.phpt
@@ -5,7 +5,7 @@ mysqli fetch long values
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/007.phpt b/ext/mysqli/tests/007.phpt
index 2470c20e7e..bd96961886 100644
--- a/ext/mysqli/tests/007.phpt
+++ b/ext/mysqli/tests/007.phpt
@@ -5,7 +5,7 @@ mysqli fetch short values
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/008.phpt b/ext/mysqli/tests/008.phpt
index c0ee735096..a57730bfc8 100644
--- a/ext/mysqli/tests/008.phpt
+++ b/ext/mysqli/tests/008.phpt
@@ -5,7 +5,7 @@ mysqli fetch tinyint values
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/009.phpt b/ext/mysqli/tests/009.phpt
index 042f837849..89f2d6e2e7 100644
--- a/ext/mysqli/tests/009.phpt
+++ b/ext/mysqli/tests/009.phpt
@@ -5,7 +5,7 @@ mysqli fetch bigint values
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/010.phpt b/ext/mysqli/tests/010.phpt
index 4584e0a91f..207144c92b 100644
--- a/ext/mysqli/tests/010.phpt
+++ b/ext/mysqli/tests/010.phpt
@@ -7,7 +7,7 @@ precision=12
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/011.phpt b/ext/mysqli/tests/011.phpt
index 987ec1d14a..fab8522a17 100644
--- a/ext/mysqli/tests/011.phpt
+++ b/ext/mysqli/tests/011.phpt
@@ -7,7 +7,7 @@ precision=12
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/012.phpt b/ext/mysqli/tests/012.phpt
index 9af509fefd..5bc766a4ab 100644
--- a/ext/mysqli/tests/012.phpt
+++ b/ext/mysqli/tests/012.phpt
@@ -7,7 +7,7 @@ precision=12
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/013.phpt b/ext/mysqli/tests/013.phpt
index b095419199..b4f9e4e166 100644
--- a/ext/mysqli/tests/013.phpt
+++ b/ext/mysqli/tests/013.phpt
@@ -5,7 +5,7 @@ mysqli fetch mixed / mysql_query
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/014.phpt b/ext/mysqli/tests/014.phpt
index 8a72c42c7f..162114cdc7 100644
--- a/ext/mysqli/tests/014.phpt
+++ b/ext/mysqli/tests/014.phpt
@@ -3,7 +3,7 @@ mysqli autocommit/commit/rollback
--SKIPIF--
<?php
include "connect.inc";
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$result = mysqli_query($link, "SHOW VARIABLES LIKE 'have_innodb'");
$row = mysqli_fetch_row($result);
mysqli_free_result($result);
@@ -16,7 +16,7 @@ mysqli autocommit/commit/rollback
--FILE--
<?php
include "connect.inc";
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/015.phpt b/ext/mysqli/tests/015.phpt
index 96864e8854..b9d70e02be 100644
--- a/ext/mysqli/tests/015.phpt
+++ b/ext/mysqli/tests/015.phpt
@@ -3,7 +3,7 @@ mysqli autocommit/commit/rollback with myisam
--SKIPIF--
<?php
include "connect.inc";
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$result = mysqli_query($link, "SHOW VARIABLES LIKE 'have_innodb'");
$row = mysqli_fetch_row($result);
mysqli_free_result($result);
@@ -17,7 +17,7 @@ mysqli autocommit/commit/rollback with myisam
<?php
include "connect.inc";
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/016.phpt b/ext/mysqli/tests/016.phpt
index 4d16356a78..0185a81569 100644
--- a/ext/mysqli/tests/016.phpt
+++ b/ext/mysqli/tests/016.phpt
@@ -5,7 +5,7 @@ mysqli fetch user variable
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/017.phpt b/ext/mysqli/tests/017.phpt
index 3447614428..d6c8f78386 100644
--- a/ext/mysqli/tests/017.phpt
+++ b/ext/mysqli/tests/017.phpt
@@ -5,7 +5,7 @@ mysqli fetch functions
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
@@ -14,7 +14,9 @@ mysqli fetch functions
mysqli_execute($stmt);
mysqli_fetch($stmt);
-// mysqli_stmt_close($stmt);
+ mysqli_stmt_close($stmt);
+
+ $c0 = ($c0 == $user . "@" . $host) ? 1 : 0;
$test = array($c0, $c1, $c2);
@@ -24,7 +26,7 @@ mysqli fetch functions
--EXPECT--
array(3) {
[0]=>
- string(14) "root@localhost"
+ int(1)
[1]=>
string(4) "test"
[2]=>
diff --git a/ext/mysqli/tests/018.phpt b/ext/mysqli/tests/018.phpt
index a0a247611d..0fb2864d52 100644
--- a/ext/mysqli/tests/018.phpt
+++ b/ext/mysqli/tests/018.phpt
@@ -5,7 +5,7 @@ mysqli fetch system variables
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/019.phpt b/ext/mysqli/tests/019.phpt
index f7aab7a799..39dd9c83a6 100644
--- a/ext/mysqli/tests/019.phpt
+++ b/ext/mysqli/tests/019.phpt
@@ -5,7 +5,7 @@ mysqli fetch (bind_param + bind_result)
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
$rc = mysqli_query($link,"DROP TABLE IF EXISTS insert_read");
diff --git a/ext/mysqli/tests/020.phpt b/ext/mysqli/tests/020.phpt
index d08930fed9..62c1657733 100644
--- a/ext/mysqli/tests/020.phpt
+++ b/ext/mysqli/tests/020.phpt
@@ -5,7 +5,7 @@ mysqli bind_param/bind_result date
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/021.phpt b/ext/mysqli/tests/021.phpt
index 614f978aaf..0ff22d4da3 100644
--- a/ext/mysqli/tests/021.phpt
+++ b/ext/mysqli/tests/021.phpt
@@ -5,7 +5,7 @@ mysqli bind_param+bind_result char/text
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/022.phpt b/ext/mysqli/tests/022.phpt
index 2fb2bcdb62..888834296c 100644
--- a/ext/mysqli/tests/022.phpt
+++ b/ext/mysqli/tests/022.phpt
@@ -5,7 +5,7 @@ mysqli bind_param/bind_result char/text long
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/023.phpt b/ext/mysqli/tests/023.phpt
index 258f1852d0..5f5e320ab7 100644
--- a/ext/mysqli/tests/023.phpt
+++ b/ext/mysqli/tests/023.phpt
@@ -5,7 +5,7 @@ mysqli bind_param/bind_prepare fetch long values
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/024.phpt b/ext/mysqli/tests/024.phpt
index de0eead6ed..7ea92479d4 100644
--- a/ext/mysqli/tests/024.phpt
+++ b/ext/mysqli/tests/024.phpt
@@ -5,7 +5,7 @@ mysqli bind_param/bind_result short values
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/025.phpt b/ext/mysqli/tests/025.phpt
index 3d643ad872..ba9db661a7 100644
--- a/ext/mysqli/tests/025.phpt
+++ b/ext/mysqli/tests/025.phpt
@@ -5,7 +5,7 @@ mysqli bind_param/bind_result tinyint values
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/026.phpt b/ext/mysqli/tests/026.phpt
index 2c7f9f02bd..9b480bb65d 100644
--- a/ext/mysqli/tests/026.phpt
+++ b/ext/mysqli/tests/026.phpt
@@ -2,12 +2,10 @@
mysqli bind_param/bind_result with send_long_data
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/027.phpt b/ext/mysqli/tests/027.phpt
index 347a8513af..2505df530c 100644
--- a/ext/mysqli/tests/027.phpt
+++ b/ext/mysqli/tests/027.phpt
@@ -2,12 +2,10 @@
function test: mysqli_stat
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$status = mysqli_stat($link);
diff --git a/ext/mysqli/tests/028.phpt b/ext/mysqli/tests/028.phpt
index d9e848f2ba..b6fab50e44 100644
--- a/ext/mysqli/tests/028.phpt
+++ b/ext/mysqli/tests/028.phpt
@@ -2,12 +2,10 @@
function test: mysqli_character_set_name
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$cset = substr(mysqli_character_set_name($link),0,6);
diff --git a/ext/mysqli/tests/029.phpt b/ext/mysqli/tests/029.phpt
index 7680b228e9..6fea5b889d 100644
--- a/ext/mysqli/tests/029.phpt
+++ b/ext/mysqli/tests/029.phpt
@@ -2,12 +2,10 @@
function test: mysqli_affected_rows
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/030.phpt b/ext/mysqli/tests/030.phpt
index da87218627..9bf7369a22 100644
--- a/ext/mysqli/tests/030.phpt
+++ b/ext/mysqli/tests/030.phpt
@@ -2,11 +2,10 @@
function test: mysqli_errno
--FILE--
<?php
- $user = "root";
- $passwd = "";
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$errno = mysqli_errno($link);
var_dump($errno);
diff --git a/ext/mysqli/tests/031.phpt b/ext/mysqli/tests/031.phpt
index 61bfb5bb32..c75bfd42b4 100644
--- a/ext/mysqli/tests/031.phpt
+++ b/ext/mysqli/tests/031.phpt
@@ -2,11 +2,10 @@
function test: mysqli_error
--FILE--
<?php
- $user = "root";
- $passwd = "";
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$error = mysqli_error($link);
var_dump($error);
diff --git a/ext/mysqli/tests/032.phpt b/ext/mysqli/tests/032.phpt
index 02564834d8..0cb4ee4d09 100644
--- a/ext/mysqli/tests/032.phpt
+++ b/ext/mysqli/tests/032.phpt
@@ -2,12 +2,10 @@
function test: mysqli_info
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/033.phpt b/ext/mysqli/tests/033.phpt
index e3d8d159d0..c9247eae60 100644
--- a/ext/mysqli/tests/033.phpt
+++ b/ext/mysqli/tests/033.phpt
@@ -2,12 +2,10 @@
function test: mysqli_get_host_info
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$hinfo = mysqli_get_host_info($link);
diff --git a/ext/mysqli/tests/034.phpt b/ext/mysqli/tests/034.phpt
index e347586a36..2d176c79fe 100644
--- a/ext/mysqli/tests/034.phpt
+++ b/ext/mysqli/tests/034.phpt
@@ -2,12 +2,10 @@
function test: mysqli_get_proto_info
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$pinfo = mysqli_get_proto_info($link);
diff --git a/ext/mysqli/tests/035.phpt b/ext/mysqli/tests/035.phpt
index a02af059d8..b402a4859f 100644
--- a/ext/mysqli/tests/035.phpt
+++ b/ext/mysqli/tests/035.phpt
@@ -2,12 +2,10 @@
function test: mysqli_get_server_info
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$sinfo = substr(mysqli_get_server_info($link),0,1);
diff --git a/ext/mysqli/tests/036.phpt b/ext/mysqli/tests/036.phpt
index 080c6e32e4..95fa182591 100644
--- a/ext/mysqli/tests/036.phpt
+++ b/ext/mysqli/tests/036.phpt
@@ -6,7 +6,7 @@ function test: mysqli_insert_id()
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/037.phpt b/ext/mysqli/tests/037.phpt
index f8b8a13f1a..a14d554b2b 100644
--- a/ext/mysqli/tests/037.phpt
+++ b/ext/mysqli/tests/037.phpt
@@ -6,7 +6,7 @@ function test: mysqli_field_count()
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/038.phpt b/ext/mysqli/tests/038.phpt
index 858b3e3393..21f9a27d6b 100644
--- a/ext/mysqli/tests/038.phpt
+++ b/ext/mysqli/tests/038.phpt
@@ -6,7 +6,7 @@ function test: mysqli_num_fields()
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/039.phpt b/ext/mysqli/tests/039.phpt
index 6ddb37bc5f..ba5915bb97 100644
--- a/ext/mysqli/tests/039.phpt
+++ b/ext/mysqli/tests/039.phpt
@@ -6,7 +6,7 @@ function test: mysqli_num_fields() 2
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_real_query($link, "SHOW VARIABLES");
diff --git a/ext/mysqli/tests/040.phpt b/ext/mysqli/tests/040.phpt
index 477e2a5274..4d7c4563c1 100644
--- a/ext/mysqli/tests/040.phpt
+++ b/ext/mysqli/tests/040.phpt
@@ -6,7 +6,7 @@ function test: mysqli_num_rows()
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/041.phpt b/ext/mysqli/tests/041.phpt
index 6fb8ee7e3f..7bc82f05c8 100644
--- a/ext/mysqli/tests/041.phpt
+++ b/ext/mysqli/tests/041.phpt
@@ -6,7 +6,7 @@ function test: mysqli_warning_count()
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/042.phpt b/ext/mysqli/tests/042.phpt
index 8db17138c0..c1384bbf68 100644
--- a/ext/mysqli/tests/042.phpt
+++ b/ext/mysqli/tests/042.phpt
@@ -5,7 +5,7 @@ mysqli_fetch_object
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/043.phpt b/ext/mysqli/tests/043.phpt
index 7aae6df9b4..1d4b1854ac 100644
--- a/ext/mysqli/tests/043.phpt
+++ b/ext/mysqli/tests/043.phpt
@@ -5,7 +5,7 @@ mysqli_bind_param (UPDATE)
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/044.phpt b/ext/mysqli/tests/044.phpt
index 5f72f65e38..cb4a272fc5 100644
--- a/ext/mysqli/tests/044.phpt
+++ b/ext/mysqli/tests/044.phpt
@@ -5,7 +5,7 @@ mysqli_get_server_version
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$i = mysqli_get_server_version($link);
diff --git a/ext/mysqli/tests/045.phpt b/ext/mysqli/tests/045.phpt
index dc58bcfb08..8e2affd085 100644
--- a/ext/mysqli/tests/045.phpt
+++ b/ext/mysqli/tests/045.phpt
@@ -3,7 +3,7 @@ mysqli_bind_result (SHOW)
--SKIPIF--
<?php
include "connect.inc";
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
@@ -20,7 +20,7 @@ mysqli_bind_result (SHOW)
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
mysqli_execute($stmt);
diff --git a/ext/mysqli/tests/046.phpt b/ext/mysqli/tests/046.phpt
index bd6bc0efdb..6adb908a4b 100644
--- a/ext/mysqli/tests/046.phpt
+++ b/ext/mysqli/tests/046.phpt
@@ -5,7 +5,7 @@ mysqli_stmt_affected_rows (delete)
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/047.phpt b/ext/mysqli/tests/047.phpt
index 7862846dc0..50540aff65 100644
--- a/ext/mysqli/tests/047.phpt
+++ b/ext/mysqli/tests/047.phpt
@@ -5,7 +5,7 @@ mysqli_get_metadata
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/048.phpt b/ext/mysqli/tests/048.phpt
index 102bcdfc26..ec849e3992 100644
--- a/ext/mysqli/tests/048.phpt
+++ b/ext/mysqli/tests/048.phpt
@@ -5,7 +5,7 @@ mysqli bind_result (OO-Style)
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $mysql = mysqli_connect("localhost", $user, $passwd);
+ $mysql = mysqli_connect($host, $user, $passwd);
$mysql->select_db("test");
$mysql->query("DROP TABLE IF EXISTS test_fetch_null");
diff --git a/ext/mysqli/tests/049.phpt b/ext/mysqli/tests/049.phpt
index 04e705de6e..869220d92e 100644
--- a/ext/mysqli/tests/049.phpt
+++ b/ext/mysqli/tests/049.phpt
@@ -5,19 +5,17 @@ mysql_fetch_row (OO-Style)
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $mysql = mysqli_connect("localhost", $user, $passwd);
+ $mysql = mysqli_connect($host, $user, $passwd);
$mysql->select_db("test");
$result = $mysql->query("SELECT CURRENT_USER()");
$row = $result->fetch_row();
$result->close();
-
- var_dump($row);
+
+ $ok = ($row[0] == $user . "@" . $host);
+ var_dump($ok);
$mysql->close();
?>
--EXPECT--
-array(1) {
- [0]=>
- string(14) "root@localhost"
-}
+bool(true)
diff --git a/ext/mysqli/tests/050.phpt b/ext/mysqli/tests/050.phpt
index 9ab5d346f8..3e8a8a37fb 100644
--- a/ext/mysqli/tests/050.phpt
+++ b/ext/mysqli/tests/050.phpt
@@ -7,7 +7,7 @@ non freed statement test
/************************
* non freed stamement
************************/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$stmt = mysqli_prepare($link, "SELECT CURRENT_USER()");
mysqli_execute($stmt);
diff --git a/ext/mysqli/tests/051.phpt b/ext/mysqli/tests/051.phpt
index dde734a1e0..807cc2f275 100644
--- a/ext/mysqli/tests/051.phpt
+++ b/ext/mysqli/tests/051.phpt
@@ -7,7 +7,7 @@ free statement after close
/************************
* free statement after close
************************/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$stmt1 = mysqli_prepare($link, "SELECT CURRENT_USER()");
mysqli_execute($stmt1);
diff --git a/ext/mysqli/tests/052.phpt b/ext/mysqli/tests/052.phpt
index 4ae9b12c50..cda1b2c844 100644
--- a/ext/mysqli/tests/052.phpt
+++ b/ext/mysqli/tests/052.phpt
@@ -7,7 +7,7 @@ call statement after close
/************************
* statement call after close
************************/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
diff --git a/ext/mysqli/tests/053.phpt b/ext/mysqli/tests/053.phpt
index f542d0f099..4bfce10b14 100644
--- a/ext/mysqli/tests/053.phpt
+++ b/ext/mysqli/tests/053.phpt
@@ -7,7 +7,7 @@ not freed resultset
/************************
* non freed resultset
************************/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$result = mysqli_query($link, "SELECT CURRENT_USER()");
mysqli_close($link);
diff --git a/ext/mysqli/tests/054.phpt b/ext/mysqli/tests/054.phpt
index eab207db4d..7c9b51fe46 100644
--- a/ext/mysqli/tests/054.phpt
+++ b/ext/mysqli/tests/054.phpt
@@ -7,7 +7,7 @@ free resultset after close
/************************
* free resultset after close
************************/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$result1 = mysqli_query($link, "SELECT CURRENT_USER()");
mysqli_close($link);
diff --git a/ext/mysqli/tests/055.phpt b/ext/mysqli/tests/055.phpt
index e777bcfc99..8fa374a6c7 100644
--- a/ext/mysqli/tests/055.phpt
+++ b/ext/mysqli/tests/055.phpt
@@ -7,7 +7,7 @@ free nothing
/************************
* don't free anything
************************/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$result2 = mysqli_query($link, "SELECT CURRENT_USER()");
$stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
diff --git a/ext/mysqli/tests/056.phpt b/ext/mysqli/tests/056.phpt
index cee7df1e5f..a681ffcf49 100644
--- a/ext/mysqli/tests/056.phpt
+++ b/ext/mysqli/tests/056.phpt
@@ -11,7 +11,7 @@ extend mysqli
}
$foo = new foobar();
- $foo->connect("localhost", $user, $passwd);
+ $foo->connect($host, $user, $passwd);
$foo->close();
printf("%s\n", $foo->test());
?>
diff --git a/ext/mysqli/tests/057.phpt b/ext/mysqli/tests/057.phpt
index 581201d8ef..fcd07f6f0b 100644
--- a/ext/mysqli/tests/057.phpt
+++ b/ext/mysqli/tests/057.phpt
@@ -5,7 +5,7 @@ mysqli_get_metadata
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/058.phpt b/ext/mysqli/tests/058.phpt
index d46e8d65a8..95bdbc1cbe 100644
--- a/ext/mysqli/tests/058.phpt
+++ b/ext/mysqli/tests/058.phpt
@@ -5,7 +5,7 @@ multiple binds
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/059.phpt b/ext/mysqli/tests/059.phpt
index 80d8a35012..151c3de961 100644
--- a/ext/mysqli/tests/059.phpt
+++ b/ext/mysqli/tests/059.phpt
@@ -5,7 +5,7 @@ sqlmode + bind
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/060.phpt b/ext/mysqli/tests/060.phpt
index f7afaa7e1a..7c753743cd 100644
--- a/ext/mysqli/tests/060.phpt
+++ b/ext/mysqli/tests/060.phpt
@@ -11,7 +11,7 @@ mysqli_fetch_object with classes
}
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
diff --git a/ext/mysqli/tests/061.phpt b/ext/mysqli/tests/061.phpt
index 438f4a203a..f1c2970011 100644
--- a/ext/mysqli/tests/061.phpt
+++ b/ext/mysqli/tests/061.phpt
@@ -10,7 +10,7 @@ local infile handler
}
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd, "test");
+ $link = mysqli_connect($host, $user, $passwd, "test");
/* create temporary file */
$fp = fopen("061.csv", "w");
diff --git a/ext/mysqli/tests/bug28817.phpt b/ext/mysqli/tests/bug28817.phpt
new file mode 100644
index 0000000000..9f2aae9563
--- /dev/null
+++ b/ext/mysqli/tests/bug28817.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Bug #28817 testcase (properties)
+--FILE--
+<?php
+ include "connect.inc";
+
+ class my_mysql extends mysqli {
+ public $p_test;
+
+ function __construct() {
+ $this->p_test[] = "foo";
+ $this->p_test[] = "bar";
+ }
+ }
+
+
+ $mysql = new my_mysql();
+
+ var_dump($mysql->p_test);
+ @var_dump($mysql->errno);
+
+ $mysql->connect($host, $user, $passwd);
+ $mysql->select_db("nonexistingdb");
+
+ var_dump($mysql->errno > 0);
+
+ $mysql->close();
+?>
+--EXPECTF--
+array(2) {
+ [0]=>
+ string(3) "foo"
+ [1]=>
+ string(3) "bar"
+}
+NULL
+bool(true)
diff --git a/ext/mysqli/tests/bug29311.phpt b/ext/mysqli/tests/bug29311.phpt
index 82845e16d6..53710cbdc8 100644
--- a/ext/mysqli/tests/bug29311.phpt
+++ b/ext/mysqli/tests/bug29311.phpt
@@ -7,7 +7,8 @@ constructor test
/* class 1 calls parent constructor */
class mysql1 extends mysqli {
function __construct() {
- parent::__construct("localhost", "root", "", "test");
+ global $host, $user, $passwd;
+ parent::__construct($host, $user, $passwd, "test");
}
}
@@ -15,7 +16,8 @@ constructor test
class mysql2 extends mysqli {
function __construct() {
- $this->connect("localhost", "root", "", "test");
+ global $host, $user, $passwd;
+ $this->connect($host, $user, $passwd, "test");
}
}
@@ -26,7 +28,7 @@ constructor test
$foo[0] = new mysql1();
$foo[1] = new mysql2();
- $foo[2] = new mysql3("localhost", "root", "", "test");
+ $foo[2] = new mysql3($host, $user, $passwd, "test");
for ($i=0; $i < 3; $i++) {
diff --git a/ext/mysqli/tests/bug30967.phpt b/ext/mysqli/tests/bug30967.phpt
index f441cf0f19..dd40194744 100644
--- a/ext/mysqli/tests/bug30967.phpt
+++ b/ext/mysqli/tests/bug30967.phpt
@@ -10,7 +10,7 @@ Bug #30967 testcase (properties)
class mysql2 extends mysql1 {
}
- $mysql = new mysql2("localhost", "root", "", "test");
+ $mysql = new mysql2($host, "root", "", "test");
$mysql->query("THIS DOES NOT WORK");
printf("%d\n", $mysql->errno);