]> granicus.if.org Git - php/commitdiff
Added testcase for bug #37090
authorGeorg Richter <georg@php.net>
Sun, 30 Jul 2006 11:03:30 +0000 (11:03 +0000)
committerGeorg Richter <georg@php.net>
Sun, 30 Jul 2006 11:03:30 +0000 (11:03 +0000)
ext/mysqli/tests/bug37090.phpt [new file with mode: 0644]

diff --git a/ext/mysqli/tests/bug37090.phpt b/ext/mysqli/tests/bug37090.phpt
new file mode 100644 (file)
index 0000000..de6043d
--- /dev/null
@@ -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"
+}