php-src/ext/mysqli/tests/bug37090.phpt
Ulf Wendel 974935e6b8 Next set of files which now feature the new environment variable
MYSQL_TEST_SKIP_CONNECT_FAILURE which controls how connection problems
are handled: failure (MYSQL_TEST_SKIP_CONNECT_FAILURE = false, default)
or skip (MYSQL_TEST_SKIP_CONNECT_FAILURE = true)

Also, some minor tweaking of connection parameters in the tests.
2007-08-09 09:43:28 +00:00

48 lines
912 B
PHP

--TEST--
Bug #37090 (mysqli_set_charset return code)
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_set_charset')) {
die('skip mysqli_set_charset() not available');
}
if (ini_get('unicode.semantics')) {
die("skip Functionality not available in unicode mode");
}
?>
--FILE--
<?php
include "connect.inc";
$mysql = new mysqli($host, $user, $passwd, $db, $port, $socket);
$cs = array();
$cs[] = $mysql->set_charset("latin5");
$cs[] = $mysql->character_set_name();
$cs[] = $mysql->set_charset("utf8");
$cs[] = $mysql->character_set_name();
$cs[] = $mysql->set_charset("notdefined");
$cs[] = $mysql->character_set_name();
var_dump($cs);
print "done!";
?>
--EXPECT--
array(6) {
[0]=>
bool(true)
[1]=>
string(6) "latin5"
[2]=>
bool(true)
[3]=>
string(4) "utf8"
[4]=>
bool(false)
[5]=>
string(4) "utf8"
}
done!