Skip to content

Commit 1fd8ec5

Browse files
committed
mysqli test updates
1 parent 5fd6079 commit 1fd8ec5

File tree

106 files changed

+14
-1202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+14
-1202
lines changed

ext/mysqli/tests/057.phpt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ require_once('skipifconnectfailure.inc');
4040

4141
var_dump(mysqli_stmt_execute($stmt));
4242
var_dump($stmt = @mysqli_prepare($link, "SELECT * FROM test_store_result"), mysqli_error($link));
43-
var_dump(mysqli_stmt_reset($stmt));
4443

4544
$stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
4645
mysqli_stmt_execute($stmt);
@@ -102,9 +101,6 @@ object(mysqli_stmt)#%d (%d) {
102101
bool(true)
103102
bool(false)
104103
string(0) ""
105-
106-
Warning: mysqli_stmt_reset() expects parameter 1 to be mysqli_stmt, bool given in %s on line %d
107-
NULL
108104
Rows: 3
109105
array(1) {
110106
[0]=>

ext/mysqli/tests/mysqli_affected_rows.phpt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@ mysqli_affected_rows()
1010
<?php
1111
require_once("connect.inc");
1212

13-
$tmp = NULL;
14-
$link = NULL;
15-
16-
if (!is_null($tmp = @mysqli_affected_rows()))
17-
printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
18-
19-
if (!is_null($tmp = @mysqli_affected_rows($link)))
20-
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
21-
22-
if (!is_null($tmp = @mysqli_affected_rows($link, $link)))
23-
printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
24-
2513
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
2614
printf("[004] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
2715
$host, $user, $db, $port, $socket);

ext/mysqli/tests/mysqli_autocommit.phpt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,6 @@ mysqli_autocommit()
1919
<?php
2020
require_once("connect.inc");
2121

22-
$tmp = NULL;
23-
$link = NULL;
24-
25-
if (!is_null($tmp = @mysqli_autocommit()))
26-
printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
27-
28-
if (!is_null($tmp = @mysqli_autocommit($link)))
29-
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
30-
31-
if (!is_null($tmp = @mysqli_autocommit($link, $link, $link)))
32-
printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
33-
3422
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
3523
printf("[004] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
3624
$host, $user, $db, $port, $socket);

ext/mysqli/tests/mysqli_begin_transaction.phpt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,10 @@ if (!have_innodb($link))
1717
<?php
1818
require_once("connect.inc");
1919
/* {{{ proto bool mysqli_begin_transaction(object link, [int flags [, string name]]) */
20-
$tmp = NULL;
21-
$link = NULL;
22-
23-
if (!is_null($tmp = @mysqli_begin_transaction()))
24-
printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
25-
26-
if (!is_null($tmp = @mysqli_begin_transaction($link)))
27-
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
28-
29-
if (!is_null($tmp = @mysqli_begin_transaction($link, $link)))
30-
printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
31-
3220
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
3321
printf("[004] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
3422
$host, $user, $db, $port, $socket);
3523

36-
if (!is_null($tmp = @mysqli_begin_transaction($link, $link)))
37-
printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
38-
39-
if (!is_null($tmp = @mysqli_begin_transaction($link, 0, $link)))
40-
printf("[006] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
41-
42-
if (!is_null($tmp = @mysqli_begin_transaction($link, 0, "mytrx", $link)))
43-
printf("[007] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
44-
4524
if (!mysqli_query($link, 'DROP TABLE IF EXISTS test'))
4625
printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
4726

ext/mysqli/tests/mysqli_change_user.phpt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,6 @@ require_once('skipifconnectfailure.inc');
1010
<?php
1111
require_once("connect.inc");
1212

13-
$tmp = NULL;
14-
$link = NULL;
15-
16-
if (!is_null($tmp = @mysqli_change_user()))
17-
printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
18-
19-
if (!is_null($tmp = @mysqli_change_user($link)))
20-
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
21-
22-
if (!is_null($tmp = @mysqli_change_user($link, $link)))
23-
printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
24-
25-
if (!is_null($tmp = @mysqli_change_user($link, $link, $link)))
26-
printf("[004] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
27-
28-
if (!is_null($tmp = @mysqli_change_user($link, $link, $link, $link, $link)))
29-
printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
30-
3113
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
3214
printf("[006] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
3315
$host, $user, $db, $port, $socket);

ext/mysqli/tests/mysqli_character_set_name.phpt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@ require_once('skipifconnectfailure.inc');
1111
/* NOTE: http://bugs.mysql.com/bug.php?id=7923 makes this test fail very likely on all 4.1.x - 5.0.x! */
1212
require_once("connect.inc");
1313

14-
$tmp = NULL;
15-
$link = NULL;
16-
17-
if (!is_null($tmp = @mysqli_character_set_name()))
18-
printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
19-
20-
if (!is_null($tmp = @mysqli_character_set_name($link)))
21-
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
22-
23-
if (!is_null($tmp = @mysqli_character_set_name($link, $link, $link)))
24-
printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
25-
2614
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
2715
printf("[005] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
2816
$host, $user, $db, $port, $socket);
@@ -65,10 +53,6 @@ require_once('skipifconnectfailure.inc');
6553
if (false !== ($tmp = @mysqli_character_set_name($link)))
6654
printf("[013] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
6755

68-
/* Make sure that the function alias exists */
69-
if (!is_null($tmp = @mysqli_character_set_name()))
70-
printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
71-
7256
print "done!";
7357
?>
7458
--EXPECT--

ext/mysqli/tests/mysqli_character_set_name_oo.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ mysqli_chararcter_set_name(), mysql_client_encoding() [alias]
1818
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
1919
$host, $user, $db, $port, $socket);
2020

21-
if (!is_null($tmp = @$mysqli->character_set_name($link)))
22-
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
23-
2421
if (!$res = $mysqli->query('SELECT version() AS server_version'))
2522
printf("[003] [%d] %s\n", $mysqli->errno, $mysqli->error);
2623
$tmp = $res->fetch_assoc();

ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ require_once('skipifconnectfailure.inc');
128128
if (!is_object($res = new mysqli_result($link, MYSQLI_USE_RESULT)))
129129
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
130130

131-
if (!is_object($res = new mysqli_result($link, 'invalid')))
132-
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
133-
134131
$valid = array(MYSQLI_STORE_RESULT, MYSQLI_USE_RESULT);
135132
do {
136133
$mode = mt_rand(-1000, 1000);
@@ -146,12 +143,6 @@ require_once('skipifconnectfailure.inc');
146143
printf("[009] Expecting warning because of invalid resultmode\n");
147144
}
148145

149-
if (!is_object($res = new mysqli_result('foo')))
150-
printf("[010] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
151-
152-
if (!is_object($res = @new mysqli_result($link, MYSQLI_STORE_RESULT, 1)))
153-
printf("[011] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
154-
155146
print "done!";
156147
?>
157148
--EXPECTF--
@@ -186,8 +177,4 @@ Access to undefined properties:
186177
mysqli_result->unknown = ''
187178

188179
Constructor:
189-
190-
Warning: mysqli_result::__construct() expects parameter 2 to be int, string given in %s on line %d
191-
192-
Warning: mysqli_result::__construct() expects parameter 1 to be mysqli, string given in %s on line %d
193180
done!

ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,6 @@ printf("stmt->unknown = '%s'\n", @$stmt->unknown);
123123
@$stmt->unknown = 13;
124124
printf("stmt->unknown = '%s'\n", @$stmt->unknown);
125125

126-
printf("\nPrepare using the constructor:\n");
127-
$stmt = new mysqli_stmt($link, 'SELECT id FROM test ORDER BY id');
128-
if (!$stmt->execute())
129-
printf("[002] [%d] %s\n", $stmt->errno, $stmt->error);
130-
$stmt->close();
131-
132-
$obj = new stdClass();
133-
if (!is_object($stmt = new mysqli_stmt($link, $obj)))
134-
printf("[003] Expecting NULL got %s/%s\n", gettype($stmt), $stmt);
135-
136126
print "done!";
137127
?>
138128
--EXPECTF--
@@ -191,8 +181,4 @@ stmt->sqlstate = '00000'
191181
Access to undefined properties:
192182
stmt->unknown = ''
193183
stmt->unknown = '13'
194-
195-
Prepare using the constructor:
196-
197-
Warning: mysqli_stmt::__construct() expects parameter 2 to be string, object given in %s on line %d
198184
done!

ext/mysqli/tests/mysqli_close.phpt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,10 @@ require_once('skipifconnectfailure.inc');
1010
<?php
1111
require_once("connect.inc");
1212

13-
$tmp = NULL;
14-
$link = NULL;
15-
16-
if (!is_null($tmp = @mysqli_close()))
17-
printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
18-
19-
if (!is_null($tmp = @mysqli_close($link, $link)))
20-
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
21-
2213
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
2314
printf("[003] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
2415
$host, $user, $db, $port, $socket);
2516

26-
$tmp = @mysqli_close(NULL);
27-
if (NULL !== $tmp)
28-
printf("[004] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
29-
3017
$tmp = mysqli_close($link);
3118
if (true !== $tmp)
3219
printf("[005] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);

0 commit comments

Comments
 (0)