Skip to content

Commit e3e67b7

Browse files
committed
Reindent more mysqli tests
Due to a bug in the tidy script, most tests did not actually get reindented...
1 parent 97d192b commit e3e67b7

File tree

374 files changed

+17809
-17809
lines changed

Some content is hidden

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

374 files changed

+17809
-17809
lines changed

ext/mysqli/tests/001.phpt

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,55 @@ require_once('skipifconnectfailure.inc');
88
?>
99
--FILE--
1010
<?php
11-
require_once("connect.inc");
12-
13-
$test = "";
14-
15-
/*** test mysqli_connect localhost:port ***/
16-
$link = my_mysqli_connect($host, $user, $passwd, "", $port, $socket);
17-
$test .= ($link) ? "1" : "0";
18-
mysqli_close($link);
19-
20-
/*** test mysqli_real_connect ***/
21-
$link = mysqli_init();
22-
$test.= (my_mysqli_real_connect($link, $host, $user, $passwd, "", $port, $socket) )
23-
? "1" : "0";
24-
mysqli_close($link);
25-
26-
/*** test mysqli_real_connect with db ***/
27-
$link = mysqli_init();
28-
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
29-
? "1" : "0";
30-
mysqli_close($link);
31-
32-
/*** test mysqli_real_connect with port ***/
33-
$link = mysqli_init();
34-
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
35-
? "1":"0";
36-
mysqli_close($link);
37-
38-
/* temporary addition for Kent's setup, Win32 box */
39-
for ($i = 0; $i < 10; $i++) {
40-
if (!$link = mysqli_init())
41-
printf("[001 + %d] mysqli_init() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
42-
43-
if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
44-
printf("[002 + %d] mysqli_real_connect() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
45-
46-
mysqli_close($link);
47-
}
48-
49-
/*** test mysqli_real_connect compressed ***/
50-
/*
51-
$link = mysqli_init();
52-
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, MYSQLI_CLIENT_COMPRESS))
53-
? "1" : "0";
54-
mysqli_close($link);
11+
require_once("connect.inc");
12+
13+
$test = "";
14+
15+
/*** test mysqli_connect localhost:port ***/
16+
$link = my_mysqli_connect($host, $user, $passwd, "", $port, $socket);
17+
$test .= ($link) ? "1" : "0";
18+
mysqli_close($link);
19+
20+
/*** test mysqli_real_connect ***/
21+
$link = mysqli_init();
22+
$test.= (my_mysqli_real_connect($link, $host, $user, $passwd, "", $port, $socket) )
23+
? "1" : "0";
24+
mysqli_close($link);
25+
26+
/*** test mysqli_real_connect with db ***/
27+
$link = mysqli_init();
28+
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
29+
? "1" : "0";
30+
mysqli_close($link);
31+
32+
/*** test mysqli_real_connect with port ***/
33+
$link = mysqli_init();
34+
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
35+
? "1":"0";
36+
mysqli_close($link);
37+
38+
/* temporary addition for Kent's setup, Win32 box */
39+
for ($i = 0; $i < 10; $i++) {
40+
if (!$link = mysqli_init())
41+
printf("[001 + %d] mysqli_init() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
42+
43+
if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
44+
printf("[002 + %d] mysqli_real_connect() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
45+
46+
mysqli_close($link);
47+
}
48+
49+
/*** test mysqli_real_connect compressed ***/
50+
/*
51+
$link = mysqli_init();
52+
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, MYSQLI_CLIENT_COMPRESS))
53+
? "1" : "0";
54+
mysqli_close($link);
5555
*/
56-
/* todo ssl connections */
56+
/* todo ssl connections */
5757

58-
var_dump($test);
59-
print "done!";
58+
var_dump($test);
59+
print "done!";
6060
?>
6161
--EXPECTF--
6262
%s(4) "1111"

ext/mysqli/tests/002.phpt

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,44 @@ require_once('skipifconnectfailure.inc');
77
?>
88
--FILE--
99
<?php
10-
require_once("connect.inc");
10+
require_once("connect.inc");
1111

12-
/*** test mysqli_connect 127.0.0.1 ***/
13-
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
14-
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
12+
/*** test mysqli_connect 127.0.0.1 ***/
13+
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
14+
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
1515

16-
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))
17-
printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
16+
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))
17+
printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
1818

19-
$rc = mysqli_query($link,"CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint,
20-
col3 int, col4 bigint,
21-
col5 float, col6 double,
22-
col7 date, col8 time,
23-
col9 varbinary(10),
24-
col10 varchar(50),
25-
col11 char(20)) ENGINE=" . $engine);
19+
$rc = mysqli_query($link,"CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint,
20+
col3 int, col4 bigint,
21+
col5 float, col6 double,
22+
col7 date, col8 time,
23+
col9 varbinary(10),
24+
col10 varchar(50),
25+
col11 char(20)) ENGINE=" . $engine);
2626

27-
if (!$rc)
28-
printf("[003] Cannot create table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
27+
if (!$rc)
28+
printf("[003] Cannot create table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
2929

30-
$rc = mysqli_query($link, "INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)");
31-
if (!$rc)
32-
printf("[004] Cannot insert records, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
30+
$rc = mysqli_query($link, "INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)");
31+
if (!$rc)
32+
printf("[004] Cannot insert records, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
3333

34-
$stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null ORDER BY col1");
35-
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
36-
mysqli_stmt_execute($stmt);
34+
$stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null ORDER BY col1");
35+
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
36+
mysqli_stmt_execute($stmt);
3737

38-
mysqli_stmt_fetch($stmt);
38+
mysqli_stmt_fetch($stmt);
3939

40-
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);
40+
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);
4141

42-
var_dump($test);
42+
var_dump($test);
4343

44-
mysqli_stmt_close($stmt);
45-
@mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null");
46-
mysqli_close($link);
47-
print "done!";
44+
mysqli_stmt_close($stmt);
45+
@mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null");
46+
mysqli_close($link);
47+
print "done!";
4848
?>
4949
--CLEAN--
5050
<?php

ext/mysqli/tests/003.phpt

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,70 +7,70 @@ require_once('skipifconnectfailure.inc');
77
?>
88
--FILE--
99
<?php
10-
require_once("connect.inc");
10+
require_once("connect.inc");
1111

12-
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
12+
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
1313

14-
mysqli_query($link, "SET sql_mode=''");
14+
mysqli_query($link, "SET sql_mode=''");
1515

16-
if (!mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result"))
17-
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
16+
if (!mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result"))
17+
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
1818

19-
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
20-
c1 date,
21-
c2 time,
22-
c3 timestamp(14),
23-
c4 year,
24-
c5 datetime,
25-
c6 timestamp(4),
26-
c7 timestamp(6)) ENGINE=" . $engine);
19+
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
20+
c1 date,
21+
c2 time,
22+
c3 timestamp(14),
23+
c4 year,
24+
c5 datetime,
25+
c6 timestamp(4),
26+
c7 timestamp(6)) ENGINE=" . $engine);
2727

28-
/*
29-
Seems that not all MySQL 6.0 installations use defaults that ignore the display widths.
30-
From the manual:
31-
From MySQL 4.1.0 on, TIMESTAMP display format differs from that of earlier MySQL releases:
32-
[...]
33-
Display widths (used as described in the preceding section) are no longer supported.
34-
In other words, for declarations such as TIMESTAMP(2), TIMESTAMP(4), and so on,
35-
the display width is ignored.
36-
[...]
37-
*/
38-
if (!$rc)
39-
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
40-
c1 date,
41-
c2 time,
42-
c3 timestamp,
43-
c4 year,
44-
c5 datetime,
45-
c6 timestamp,
46-
c7 timestamp) ENGINE=" . $engine);
28+
/*
29+
Seems that not all MySQL 6.0 installations use defaults that ignore the display widths.
30+
From the manual:
31+
From MySQL 4.1.0 on, TIMESTAMP display format differs from that of earlier MySQL releases:
32+
[...]
33+
Display widths (used as described in the preceding section) are no longer supported.
34+
In other words, for declarations such as TIMESTAMP(2), TIMESTAMP(4), and so on,
35+
the display width is ignored.
36+
[...]
37+
*/
38+
if (!$rc)
39+
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
40+
c1 date,
41+
c2 time,
42+
c3 timestamp,
43+
c4 year,
44+
c5 datetime,
45+
c6 timestamp,
46+
c7 timestamp) ENGINE=" . $engine);
4747

48-
if (!$rc)
49-
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
48+
if (!$rc)
49+
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
5050

51-
$rc = mysqli_query($link, "INSERT INTO test_bind_result VALUES(
52-
'2002-01-02',
53-
'12:49:00',
54-
'2002-01-02 17:46:59',
55-
2010,
56-
'2010-07-10',
57-
'2020','1999-12-29')");
58-
if (!$rc)
59-
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
51+
$rc = mysqli_query($link, "INSERT INTO test_bind_result VALUES(
52+
'2002-01-02',
53+
'12:49:00',
54+
'2002-01-02 17:46:59',
55+
2010,
56+
'2010-07-10',
57+
'2020','1999-12-29')");
58+
if (!$rc)
59+
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
6060

61-
$stmt = mysqli_prepare($link, "SELECT c1, c2, c3, c4, c5, c6, c7 FROM test_bind_result");
62-
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
63-
mysqli_stmt_execute($stmt);
64-
mysqli_stmt_fetch($stmt);
61+
$stmt = mysqli_prepare($link, "SELECT c1, c2, c3, c4, c5, c6, c7 FROM test_bind_result");
62+
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
63+
mysqli_stmt_execute($stmt);
64+
mysqli_stmt_fetch($stmt);
6565

66-
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
66+
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
6767

68-
var_dump($test);
68+
var_dump($test);
6969

70-
mysqli_stmt_close($stmt);
71-
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
72-
mysqli_close($link);
73-
print "done!";
70+
mysqli_stmt_close($stmt);
71+
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
72+
mysqli_close($link);
73+
print "done!";
7474
?>
7575
--CLEAN--
7676
<?php

ext/mysqli/tests/004.phpt

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,48 @@ require_once('skipifconnectfailure.inc');
77
?>
88
--FILE--
99
<?php
10-
include ("connect.inc");
10+
include ("connect.inc");
1111

12-
/*** test mysqli_connect 127.0.0.1 ***/
13-
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
12+
/*** test mysqli_connect 127.0.0.1 ***/
13+
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
1414

15-
mysqli_select_db($link, $db);
15+
mysqli_select_db($link, $db);
1616

17-
if (!mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"))
18-
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
17+
if (!mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"))
18+
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
1919

20-
if (!mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text) ENGINE=" . $engine))
21-
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
20+
if (!mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text) ENGINE=" . $engine))
21+
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
2222

23-
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890', 'this is a test0')"))
24-
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
23+
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890', 'this is a test0')"))
24+
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
2525

26-
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567891', 'this is a test1')"))
27-
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
26+
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567891', 'this is a test1')"))
27+
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
2828

29-
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567892', 'this is a test2')"))
30-
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
29+
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567892', 'this is a test2')"))
30+
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
3131

32-
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567893', 'this is a test3')"))
33-
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
32+
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567893', 'this is a test3')"))
33+
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
3434

35-
if (!$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch ORDER BY c1"))
36-
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
35+
if (!$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch ORDER BY c1"))
36+
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
3737

38-
$c1 = $c2 = NULL;
39-
mysqli_stmt_bind_result($stmt, $c1, $c2);
40-
mysqli_stmt_execute($stmt);
41-
$i = 4;
42-
while ($i--) {
43-
mysqli_stmt_fetch($stmt);
44-
$test = array($c1, $c2);
45-
var_dump($test);
46-
}
38+
$c1 = $c2 = NULL;
39+
mysqli_stmt_bind_result($stmt, $c1, $c2);
40+
mysqli_stmt_execute($stmt);
41+
$i = 4;
42+
while ($i--) {
43+
mysqli_stmt_fetch($stmt);
44+
$test = array($c1, $c2);
45+
var_dump($test);
46+
}
4747

48-
mysqli_stmt_close($stmt);
49-
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
50-
mysqli_close($link);
51-
print "done!";
48+
mysqli_stmt_close($stmt);
49+
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
50+
mysqli_close($link);
51+
print "done!";
5252
?>
5353
--CLEAN--
5454
<?php

0 commit comments

Comments
 (0)