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

49 lines
943 B
Plaintext
Raw Normal View History

2006-07-30 11:03:30 +00:00
--TEST--
2007-05-07 18:03:01 +00:00
Bug #37090 (mysqli_set_charset return code)
2006-07-30 11:03:30 +00:00
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
2006-11-13 12:47:43 +00:00
if (!function_exists('mysqli_set_charset')) {
die('skip mysqli_set_charset() not available');
}
if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) {
die("skip Functionality not available in unicode mode");
}
2006-11-13 12:47:43 +00:00
?>
2006-07-30 11:03:30 +00:00
--FILE--
<?php
require_once("connect.inc");
2006-07-30 11:03:30 +00:00
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
2006-07-30 11:03:30 +00:00
$cs = array();
$cs[] = $mysql->set_charset("latin1");
2006-07-30 11:03:30 +00:00
$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!";
2006-07-30 11:03:30 +00:00
?>
--EXPECT--
array(6) {
[0]=>
bool(true)
[1]=>
string(6) "latin1"
2006-07-30 11:03:30 +00:00
[2]=>
bool(true)
[3]=>
string(4) "utf8"
[4]=>
bool(false)
[5]=>
string(4) "utf8"
}
done!