php-src/ext/mysqli/tests/mysqli_disable_rpl_parse.phpt

41 lines
1.2 KiB
PHP

--TEST--
mysqli_disable_rpl_parse()
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_disable_rpl_parse'))
die("skip mysqli_disable_rpl_parse() not available");
?>
--FILE--
<?php
include "connect.inc";
$tmp = NULL;
$link = NULL;
if (NULL !== ($tmp = @mysqli_disable_rpl_parse()))
printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
if (NULL !== ($tmp = @mysqli_disable_rpl_parse($link)))
printf("[002] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
printf("[003] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket);
}
if (!is_bool($tmp = mysqli_disable_rpl_parse($link)))
printf("[004] Expecting boolean/[true|false] value, got %s/%s\n", gettype($tmp), $tmp);
mysqli_close($link);
if (NULL !== ($tmp = mysqli_disable_rpl_parse($link)))
printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
print "done!";
?>
--EXPECTF--
Warning: mysqli_disable_rpl_parse(): Couldn't fetch mysqli in %s on line %d
done!