Skip to content

Commit 3a080e8

Browse files
committed
fix tests
1 parent acdd739 commit 3a080e8

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

ext/mysql/tests/mysql_affected_rows.phpt

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ mysql_affected_rows()
44
<?php
55
require_once('skipif.inc');
66
require_once('skipifconnectfailure.inc');
7+
require_once('skipifdefaultconnectfailure.inc');
78
?>
89
--FILE--
910
<?php
@@ -12,8 +13,8 @@ include_once("connect.inc");
1213
$tmp = NULL;
1314
$link = NULL;
1415

15-
if (false !== ($tmp = @mysql_affected_rows()))
16-
printf("[001] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
16+
if (0 !== ($tmp = @mysql_affected_rows()))
17+
printf("[001] Expecting int/0, got %s/%s\n", gettype($tmp), $tmp);
1718

1819
if (null !== ($tmp = @mysql_affected_rows($link)))
1920
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);

ext/mysql/tests/mysql_insert_id.phpt

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ mysql_insert_id()
44
<?php
55
require_once('skipif.inc');
66
require_once('skipifconnectfailure.inc');
7+
require_once('skipifdefaultconnectfailure.inc');
78
?>
89
--FILE--
910
<?php
@@ -12,8 +13,8 @@ include "connect.inc";
1213
$tmp = NULL;
1314
$link = NULL;
1415

15-
if (false !== ($tmp = @mysql_insert_id()))
16-
printf("[001] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
16+
if (0 !== ($tmp = @mysql_insert_id()))
17+
printf("[001] Expecting int/0, got %s/%s\n", gettype($tmp), $tmp);
1718

1819
if (NULL !== ($tmp = @mysql_insert_id($link)))
1920
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
if ($skip_on_connect_failure) {
3+
if (!$link = @mysql_connect())
4+
die(sprintf("skip Can't connect to MySQL Server with default credentials - [%d] %s", mysql_errno(), mysql_error()));
5+
6+
if (!@mysql_select_db($db, $link))
7+
die(sprintf("skip Can't connect to MySQL Server with default credentials - [%d] %s", mysql_errno(), mysql_error()));
8+
9+
mysql_close($link);
10+
}
11+
?>

0 commit comments

Comments
 (0)