Skip to content

Commit 05ed3b7

Browse files
Remove duplicated SKIP checks from mysqli tests (php#7858)
1 parent e127f3f commit 05ed3b7

File tree

85 files changed

+381
-451
lines changed

Some content is hidden

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

85 files changed

+381
-451
lines changed

ext/mysqli/tests/014.phpt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@ mysqli autocommit/commit/rollback
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once('skipifconnectfailure.inc');
8-
require_once("connect.inc");
9-
10-
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
11-
if (!$link)
12-
die(sprintf("skip Cannot connect, [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
7+
require_once "connect.inc";
8+
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
9+
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
10+
}
1311

14-
if (!have_innodb($link))
15-
die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error));
12+
if (!have_innodb($link)) {
13+
die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error));
14+
}
1615
?>
1716
--FILE--
1817
<?php
19-
require_once("connect.inc");
18+
require_once "connect.inc";
2019
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
2120

2221
if (!mysqli_autocommit($link, TRUE))
@@ -79,7 +78,7 @@ mysqli
7978
?>
8079
--CLEAN--
8180
<?php
82-
require_once("clean_table.inc");
81+
require_once "clean_table.inc";
8382
?>
8483
--EXPECT--
8584
Num_of_rows=1

ext/mysqli/tests/015.phpt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ mysqli autocommit/commit/rollback with innodb
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once('skipifconnectfailure.inc');
8-
9-
require_once('connect.inc');
10-
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
11-
die(sprintf("skip Cannot connect, [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
7+
require_once "connect.inc";
8+
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
9+
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
10+
}
1211

13-
if (!have_innodb($link))
14-
die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error));
12+
if (!have_innodb($link)) {
13+
die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error));
14+
}
1515
?>
1616
--FILE--
1717
<?php
18-
require_once("connect.inc");
18+
require_once "connect.inc";
1919

2020
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
2121
if (!$link)
@@ -77,7 +77,7 @@ mysqli
7777
?>
7878
--CLEAN--
7979
<?php
80-
require_once("clean_table.inc");
80+
require_once "clean_table.inc";
8181
?>
8282
--EXPECT--
8383
array(2) {

ext/mysqli/tests/045.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ mysqli_stmt_bind_result (SHOW)
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once('skipifconnectfailure.inc');
7+
require_once 'skipifconnectfailure.inc';
88

9-
require_once("connect.inc");
109
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
1110

1211
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
@@ -20,7 +19,7 @@ mysqli
2019
?>
2120
--FILE--
2221
<?php
23-
require_once("connect.inc");
22+
require_once "connect.inc";
2423

2524
/*** test mysqli_connect 127.0.0.1 ***/
2625
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);

ext/mysqli/tests/067.phpt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ function test: nested selects (cursors)
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once('skipifconnectfailure.inc');
8-
require_once("connect.inc");
7+
require_once "connect.inc";
98

10-
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
11-
die("skip Cannot connect to check required version");
9+
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
10+
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
1211

1312
/* skip cursor test for server versions < 50009 */
1413
if (mysqli_get_server_version($link) < 50009) {
@@ -29,7 +28,7 @@ mysqli
2928
return $stmt;
3029
}
3130

32-
require_once("connect.inc");
31+
require_once "connect.inc";
3332
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
3433

3534
if (mysqli_get_server_version($mysql) < 50009) {
@@ -65,7 +64,7 @@ mysqli
6564
?>
6665
--CLEAN--
6766
<?php
68-
require_once("connect.inc");
67+
require_once "connect.inc";
6968
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
7069
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
7170

ext/mysqli/tests/bug42548.phpt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ Bug #42548 PROCEDURE xxx can't return a result set in the given context (works i
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once('skipifconnectfailure.inc');
8-
require_once('connect.inc');
9-
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
7+
require_once 'connect.inc';
8+
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
109
die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error()));
1110
}
1211
if (mysqli_get_server_version($link) <= 50000) {
@@ -15,7 +14,7 @@ if (mysqli_get_server_version($link) <= 50000) {
1514
?>
1615
--FILE--
1716
<?php
18-
require_once('connect.inc');
17+
require_once 'connect.inc';
1918

2019
$mysqli = mysqli_init();
2120
$mysqli->real_connect($host, $user, $passwd, $db, $port, $socket);
@@ -53,7 +52,7 @@ print "done!";
5352
?>
5453
--CLEAN--
5554
<?php
56-
require_once("connect.inc");
55+
require_once "connect.inc";
5756
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
5857
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
5958

ext/mysqli/tests/bug44897.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Bug #44879 (failed to prepare statement)
44
mysqli
55
--SKIPIF--
66
<?php
7-
if (!stristr(mysqli_get_client_info(), 'mysqlnd'))
8-
die("skip: only available in mysqlnd");
7+
require_once 'connect.inc';
98

10-
require_once('skipifconnectfailure.inc');
11-
require_once('connect.inc');
9+
if (!$IS_MYSQLND) {
10+
die("skip: only available in mysqlnd");
11+
}
1212

13-
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
14-
die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error()));
13+
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
14+
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
1515
}
1616
if (mysqli_get_server_version($link) <= 50000) {
1717
die(sprintf('skip Needs MySQL 5.0+, found version %d.', mysqli_get_server_version($link)));

ext/mysqli/tests/bug49442.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Bug #49422 (mysqlnd: mysqli_real_connect() and LOAD DATA INFILE crash)
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once('skipifconnectfailure.inc');
7+
require_once 'connect.inc';
88

99
$link = mysqli_init();
10-
if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) {
11-
die(sprintf("skip Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()));
10+
if (!@my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) {
11+
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
1212
}
1313

14-
include_once("local_infile_tools.inc");
14+
include_once "local_infile_tools.inc";
1515
if ($msg = check_local_infile_support($link, $engine))
1616
die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
1717

@@ -23,7 +23,7 @@ mysqli.allow_persistent=1
2323
mysqli.max_persistent=1
2424
--FILE--
2525
<?php
26-
include ("connect.inc");
26+
include "connect.inc";
2727

2828
$link = mysqli_init();
2929
if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) {
@@ -107,7 +107,7 @@ mysqli.max_persistent=1
107107
?>
108108
--CLEAN--
109109
<?php
110-
require_once("clean_table.inc");
110+
require_once "clean_table.inc";
111111
?>
112112
--EXPECT--
113113
array(2) {

ext/mysqli/tests/bug51647.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ Bug #51647 (Certificate file without private key (pk in another file) doesn't wo
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once('skipifconnectfailure.inc');
8-
require_once("connect.inc");
7+
require_once "connect.inc";
98

109
if (!defined('MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT'))
1110
die("skip Requires MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT");
@@ -43,7 +42,7 @@ $link->close();
4342
?>
4443
--FILE--
4544
<?php
46-
include ("connect.inc");
45+
include "connect.inc";
4746

4847
if (!is_object($link = mysqli_init()))
4948
printf("[001] Cannot create link\n");

ext/mysqli/tests/bug53503.phpt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ Bug #53503 (mysqli::query returns false after successful LOAD DATA query)
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once('skipifconnectfailure.inc');
7+
require_once 'connect.inc';
88

9-
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
10-
die("skip Cannot connect to MySQL");
9+
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
10+
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
11+
}
1112

12-
include_once("local_infile_tools.inc");
13+
include_once "local_infile_tools.inc";
1314
if ($msg = check_local_infile_support($link, $engine))
1415
die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
1516

1617
mysqli_close($link);
17-
1818
?>
1919
--INI--
2020
mysqli.allow_local_infile=1
2121
--FILE--
2222
<?php
23-
require_once("connect.inc");
23+
require_once "connect.inc";
2424

2525
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
2626
printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
@@ -50,7 +50,7 @@ mysqli.allow_local_infile=1
5050
?>
5151
--CLEAN--
5252
<?php
53-
require_once('connect.inc');
53+
require_once 'connect.inc';
5454

5555
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
5656
printf("[clean] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",

ext/mysqli/tests/bug55283.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ Bug #55283 (SSL options set by mysqli_ssl_set ignored for MySQLi persistent conn
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once('skipifconnectfailure.inc');
8-
require_once("connect.inc");
7+
require_once "connect.inc";
98

109
if (!defined('MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT'))
1110
die("skip Requires MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT");

ext/mysqli/tests/bug55582.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ Bug #55582 mysqli_num_rows() returns always 0 for unbuffered, when mysqlnd is us
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once('skipifconnectfailure.inc');
8-
require_once("connect.inc");
7+
require_once 'skipifconnectfailure.inc';
98
?>
109
--FILE--
1110
<?php

ext/mysqli/tests/bug63398.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ Bug #63398 (Segfault when polling closed link)
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once("connect.inc");
7+
require_once "skipifconnectfailure.inc";
88
if (!$IS_MYSQLND) {
99
die("skip mysqlnd only test");
1010
}
11-
require_once('skipifconnectfailure.inc');
1211
?>
1312
--FILE--
1413
<?php

ext/mysqli/tests/bug64726.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ Bug #63398 (Segfault when calling fetch_object on a use_result and DB pointer ha
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once("connect.inc");
7+
require_once "skipifconnectfailure.inc";
88
if (!$IS_MYSQLND) {
99
die("skip mysqlnd only test");
1010
}
11-
require_once('skipifconnectfailure.inc');
1211
?>
1312
--FILE--
1413
<?php

ext/mysqli/tests/bug68077.phpt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ Bug #68077 (LOAD DATA LOCAL INFILE / open_basedir restriction)
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once('skipifconnectfailure.inc');
7+
require_once 'connect.inc';
88
if (!$IS_MYSQLND) {
99
die("skip: test applies only to mysqlnd");
1010
}
11-
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
12-
die("skip Cannot connect to MySQL");
11+
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
12+
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
13+
}
1314

14-
include_once("local_infile_tools.inc");
15+
include_once "local_infile_tools.inc";
1516
if ($msg = check_local_infile_support($link, $engine))
1617
die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
1718

ext/mysqli/tests/bug69899.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ mysqli
1111
--SKIPIF--
1212
<?php
1313
require_once __DIR__ . '/skipifconnectfailure.inc';
14-
require_once __DIR__ . '/connect.inc';
1514
if (!$IS_MYSQLND) {
1615
die('skip mysqlnd only');
1716
}

ext/mysqli/tests/bug70384.phpt

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@ mysqli_float_handling - ensure 4 byte float is handled correctly
44
mysqli
55
--SKIPIF--
66
<?php
7-
require_once('skipifconnectfailure.inc');
8-
if (@$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
9-
if ($link->server_version < 50709) {
10-
die("skip MySQL 5.7.9+ needed. Found [".
11-
intval(substr($link->server_version."", -5, 1)).
12-
".".
13-
intval(substr($link->server_version."", -4, 2)).
14-
".".
15-
intval(substr($link->server_version."", -2, 2)).
16-
"]");
17-
}
18-
}
7+
require_once 'connect.inc';
8+
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
9+
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
10+
}
11+
12+
if ($link->server_version < 50709) {
13+
die("skip MySQL 5.7.9+ needed. Found [".
14+
intval(substr($link->server_version."", -5, 1)).
15+
".".
16+
intval(substr($link->server_version."", -4, 2)).
17+
".".
18+
intval(substr($link->server_version."", -2, 2)).
19+
"]");
20+
}
1921
?>
2022
--FILE--
2123
<?php
22-
require('connect.inc');
24+
require 'connect.inc';
2325
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
2426
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
2527
die();
@@ -56,7 +58,7 @@ mysqli
5658
?>
5759
--CLEAN--
5860
<?php
59-
require_once("clean_table.inc");
61+
require_once "clean_table.inc";
6062
?>
6163
--EXPECT--
6264
OK

0 commit comments

Comments
 (0)