summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/mysqli/tests/bug37090.phpt37
1 files changed, 37 insertions, 0 deletions
diff --git a/ext/mysqli/tests/bug37090.phpt b/ext/mysqli/tests/bug37090.phpt
new file mode 100644
index 0000000000..de6043d38a
--- /dev/null
+++ b/ext/mysqli/tests/bug37090.phpt
@@ -0,0 +1,37 @@
+--TEST--
+bug #37090: mysqli_set_charset return code
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ include "connect.inc";
+
+ $mysql = new mysqli($host, $user, $passwd);
+
+ $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);
+?>
+--EXPECT--
+array(6) {
+ [0]=>
+ bool(true)
+ [1]=>
+ string(6) "latin5"
+ [2]=>
+ bool(true)
+ [3]=>
+ string(4) "utf8"
+ [4]=>
+ bool(false)
+ [5]=>
+ string(4) "utf8"
+}