File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / mysqli / tests / bug37090.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:58 2012 UTC (12 years, 4 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
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 ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) {
	die("skip Functionality not available in unicode mode");
}
?>
--FILE--
<?php
	require_once("connect.inc");

	$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);

	$cs = array();
	$cs[] = $mysql->set_charset("latin1");
	$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) "latin1"
  [2]=>
  bool(true)
  [3]=>
  string(4) "utf8"
  [4]=>
  bool(false)
  [5]=>
  string(4) "utf8"
}
done!

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>