Skip to content

Commit 234397c

Browse files
committed
ext/mysqli: Remove bool type coercions in tests
1 parent 81fba27 commit 234397c

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

ext/mysqli/tests/mysqli_prepare_no_object.phpt

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,20 @@ require_once 'skipifconnectfailure.inc';
88
?>
99
--FILE--
1010
<?php
11-
require 'table.inc';
11+
require 'table.inc';
12+
if (false !== ($tmp = mysqli_prepare($link, '')))
13+
printf("[002] Expecting boolean/false, got %s/%s\n", gettype($tmp), var_export($tmp, true));
14+
printf("a) [%d] %s\n", mysqli_errno($link), mysqli_error($link));
1215

13-
if (false !== ($tmp = mysqli_prepare($link, false)))
14-
printf("[001] Expecting boolean/false, got %s/%s\n", gettype($tmp), var_export($tmp, true));
15-
printf("a) [%d] %s\n", mysqli_errno($link), mysqli_error($link));
16+
mysqli_close($link);
1617

17-
if (false !== ($tmp = mysqli_prepare($link, '')))
18-
printf("[002] Expecting boolean/false, got %s/%s\n", gettype($tmp), var_export($tmp, true));
19-
printf("b) [%d] %s\n", mysqli_errno($link), mysqli_error($link));
18+
$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
2019

21-
mysqli_close($link);
20+
if (false !== ($tmp = $mysqli->prepare('')))
21+
printf("[005] Expecting boolean/false, got %s/%s\n", gettype($tmp), var_export($tmp, true));
22+
printf("b) [%d] %s\n", $mysqli->errno, $mysqli->error);
2223

23-
$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
24-
25-
if (false !== ($tmp = $mysqli->prepare(false)))
26-
printf("[004] Expecting boolean/false, got %s/%s\n", gettype($tmp), var_export($tmp, true));
27-
printf("c) [%d] %s\n", $mysqli->errno, $mysqli->error);
28-
29-
if (false !== ($tmp = $mysqli->prepare('')))
30-
printf("[005] Expecting boolean/false, got %s/%s\n", gettype($tmp), var_export($tmp, true));
31-
printf("c) [%d] %s\n", $mysqli->errno, $mysqli->error);
32-
33-
print "done!";
24+
print "done!";
3425
?>
3526
--CLEAN--
3627
<?php
@@ -39,6 +30,4 @@ require_once 'clean_table.inc';
3930
--EXPECT--
4031
a) [1065] Query was empty
4132
b) [1065] Query was empty
42-
c) [1065] Query was empty
43-
c) [1065] Query was empty
4433
done!

0 commit comments

Comments
 (0)