uw Thu Aug 9 09:59:15 2007 UTC
Added files:
/php-src/ext/mysqli/tests mysqli_master_query.phpt
mysqli_rpl_parse_enabled.phpt
mysqli_rpl_probe.phpt
mysqli_rpl_query_type.phpt
mysqli_send_query.phpt
mysqli_slave_query.phpt
Log:
New tests (stubs?) for a few experimental (to be removed?) functions.
The tests will only be run if you set MYSQL_TEST_EXPERIMENTAL = 1.
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_master_query.phpt?view=markup&rev=1.1
Index: php-src/ext/mysqli/tests/mysqli_master_query.phpt
+++ php-src/ext/mysqli/tests/mysqli_master_query.phpt
--TEST--
mysqli_master_query()
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_master_query')) {
die("skip mysqli_master_query() not available");
}
require_once('connect.inc');
if (!$TEST_EXPERIMENTAL)
die("skip - experimental (= unsupported) feature");
?>
--FILE--
<?php
/* NOTE: tests is a stub, but function is deprecated, as long as it
does not crash when invoking it... */
include "connect.inc";
$tmp = NULL;
$link = NULL;
if (NULL !== ($tmp = @mysqli_master_query()))
printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp),
$tmp);
if (NULL !== ($tmp = @mysqli_master_query($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_master_query($link, 'SELECT 1')))
printf("[004] Expecting boolean/[true|false] value, got
%s/%s\n", gettype($tmp), $tmp);
mysqli_close($link);
if (NULL !== ($tmp = mysqli_master_query($link)))
printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp),
$tmp);
print "done!";
?>
--EXPECTF--
Warning: mysqli_master_query(): Couldn't fetch mysqli in %s on line %d
done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_rpl_parse_enabled.phpt?view=markup&rev=1.1
Index: php-src/ext/mysqli/tests/mysqli_rpl_parse_enabled.phpt
+++ php-src/ext/mysqli/tests/mysqli_rpl_parse_enabled.phpt
--TEST--
mysqli_rpl_parse_enabled()
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_rpl_parse_enabled')) {
die("skip mysqli_rpl_parse_enabled() not available");
}
require_once('connect.inc');
if (!$TEST_EXPERIMENTAL)
die("skip - experimental (= unsupported) feature");
?>
--FILE--
<?php
/* NOTE: tests is a stub, but function is deprecated, as long as it
does not crash when invoking it... */
include "connect.inc";
$tmp = NULL;
$link = NULL;
if (NULL !== ($tmp = @mysqli_rpl_parse_enabled()))
printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp),
$tmp);
if (NULL !== ($tmp = @mysqli_rpl_parse_enabled($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_int($tmp = mysqli_rpl_parse_enabled($link)))
printf("[004] Expecting integer/any value, got %s/%s\n",
gettype($tmp), $tmp);
mysqli_close($link);
if (NULL !== ($tmp = mysqli_rpl_parse_enabled($link)))
printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp),
$tmp);
print "done!";
?>
--EXPECTF--
Warning: mysqli_rpl_parse_enabled(): Couldn't fetch mysqli in %s on line %d
done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_rpl_probe.phpt?view=markup&rev=1.1
Index: php-src/ext/mysqli/tests/mysqli_rpl_probe.phpt
+++ php-src/ext/mysqli/tests/mysqli_rpl_probe.phpt
--TEST--
mysqli_rpl_probe()
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_rpl_probe')) {
die("skip mysqli_rpl_probe() not available");
}
require_once('connect.inc');
if (!$TEST_EXPERIMENTAL)
die("skip - experimental (= unsupported) feature");
?>
--FILE--
<?php
/* NOTE: tests is a stub, but function is deprecated, as long as it
does not crash when invoking it... */
include "connect.inc";
$tmp = NULL;
$link = NULL;
if (NULL !== ($tmp = @mysqli_rpl_probe()))
printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp),
$tmp);
if (NULL !== ($tmp = @mysqli_rpl_probe($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_rpl_probe($link)))
printf("[004] Expecting boolean/any value, got %s/%s\n",
gettype($tmp), $tmp);
mysqli_close($link);
if (NULL !== ($tmp = mysqli_rpl_probe($link)))
printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp),
$tmp);
print "done!";
?>
--EXPECTF--
Warning: mysqli_rpl_probe(): Couldn't fetch mysqli in %s on line %d
done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_rpl_query_type.phpt?view=markup&rev=1.1
Index: php-src/ext/mysqli/tests/mysqli_rpl_query_type.phpt
+++ php-src/ext/mysqli/tests/mysqli_rpl_query_type.phpt
--TEST--
mysqli_rpl_query_type()
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_rpl_query_type')) {
die("skip mysqli_rpl_query_type() not available");
}
require_once('connect.inc');
if (!$TEST_EXPERIMENTAL)
die("skip - experimental (= unsupported) feature");
?>
--FILE--
<?php
/* NOTE: tests is a stub, but function is deprecated, as long as it
does not crash when invoking it... */
include "connect.inc";
$tmp = NULL;
$link = NULL;
if (NULL !== ($tmp = @mysqli_rpl_query_type()))
printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp),
$tmp);
if (NULL !== ($tmp = @mysqli_rpl_query_type($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);
}
$query = array();
if (NULL !== ($tmp = @mysqli_rpl_query_type($link, $query)))
printf("[004] Expecting NULL/NULL, got %s/%s\n", gettype($tmp),
$tmp);
if (!is_int($tmp = mysqli_rpl_query_type($link, 'SELECT 1')))
printf("[005] Expecting integer/any value, got %s/%s\n",
gettype($tmp), $tmp);
mysqli_close($link);
if (NULL !== ($tmp = mysqli_rpl_query_type($link, 'SELECT 1')))
printf("[006] Expecting NULL, got %s/%s\n", gettype($tmp),
$tmp);
print "done!";
?>
--EXPECTF--
Warning: mysqli_rpl_query_type(): Couldn't fetch mysqli in %s on line %d
done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_send_query.phpt?view=markup&rev=1.1
Index: php-src/ext/mysqli/tests/mysqli_send_query.phpt
+++ php-src/ext/mysqli/tests/mysqli_send_query.phpt
--TEST--
mysqli_send_query()
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_send_query')) {
die("skip mysqli_send_query() not available");
}
require_once('connect.inc');
if (!$TEST_EXPERIMENTAL)
die("skip - experimental (= unsupported) feature");
?>
--FILE--
<?php
/* NOTE: tests is a stub, but function is deprecated, as long as it
does not crash when invoking it... */
include "connect.inc";
$tmp = NULL;
$link = NULL;
if (NULL !== ($tmp = @mysqli_send_query()))
printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp),
$tmp);
if (NULL !== ($tmp = @mysqli_send_query($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);
}
$query = array();
if (NULL !== ($tmp = @mysqli_send_query($link, $query)))
printf("[004] Expecting NULL/NULL, got %s/%s\n", gettype($tmp),
$tmp);
if (!is_int($tmp = mysqli_send_query($link, 'SELECT 1')))
printf("[005] Expecting integer/any value, got %s/%s\n",
gettype($tmp), $tmp);
mysqli_close($link);
if (NULL !== ($tmp = mysqli_send_query($link, 'SELECT 1')))
printf("[006] Expecting NULL, got %s/%s\n", gettype($tmp),
$tmp);
print "done!";
?>
--EXPECTF--
Warning: mysqli_send_query(): Couldn't fetch mysqli in %s on line %d
done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_slave_query.phpt?view=markup&rev=1.1
Index: php-src/ext/mysqli/tests/mysqli_slave_query.phpt
+++ php-src/ext/mysqli/tests/mysqli_slave_query.phpt
--TEST--
mysqli_slave_query()
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_slave_query')) {
die("skip mysqli_slave_query() not available");
}
require_once('connect.inc');
if (!$TEST_EXPERIMENTAL)
die("skip - experimental (= unsupported) feature");
?>
--FILE--
<?php
/* NOTE: tests is a stub, but function is deprecated, as long as it
does not crash when invoking it... */
include "connect.inc";
$tmp = NULL;
$link = NULL;
if (NULL !== ($tmp = @mysqli_slave_query()))
printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp),
$tmp);
if (NULL !== ($tmp = @mysqli_slave_query($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);
}
$query = array();
if (NULL !== ($tmp = @mysqli_slave_query($link, $query)))
printf("[004] Expecting NULL/NULL, got %s/%s\n", gettype($tmp),
$tmp);
if (!is_int($tmp = mysqli_slave_query($link, 'SELECT 1')))
printf("[005] Expecting integer/any value, got %s/%s\n",
gettype($tmp), $tmp);
mysqli_close($link);
if (NULL !== ($tmp = mysqli_slave_query($link, 'SELECT 1')))
printf("[006] Expecting NULL, got %s/%s\n", gettype($tmp),
$tmp);
print "done!";
?>
--EXPECTF--
Warning: mysqli_slave_query(): Couldn't fetch mysqli in %s on line %d
done!
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php