From: Ulf Wendel Date: Thu, 12 Jul 2007 14:23:56 +0000 (+0000) Subject: Whoever has hacked this function into ext/mysql, here's a "test" for it. X-Git-Tag: BEFORE_IMPORT_OF_MYSQLND~174 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2135a5b3f66b5788a218a0fbd14cae6bdd728124;p=php Whoever has hacked this function into ext/mysql, here's a "test" for it. --- diff --git a/ext/mysql/tests/mysql_set_charset.phpt b/ext/mysql/tests/mysql_set_charset.phpt new file mode 100644 index 0000000000..8ccdbabcce --- /dev/null +++ b/ext/mysql/tests/mysql_set_charset.phpt @@ -0,0 +1,58 @@ +--TEST-- +mysql_set_charset() - STUB, function usage not recommended +--SKIPIF-- + +--FILE-- + $charset) { + if (!($res = mysql_query(sprintf('SHOW CHARACTER SET LIKE "%s"', $charset), $link))) + continue; + mysql_free_result($res); + if ($expect !== ($tmp = @mysql_set_charset($charset, $link))) + printf("[006] Expecting %s/%s got %s/%s\n", + gettype($expect), $expect, + gettype($tmp), $tmp); +} + +mysql_close($link); +print "done!"; +?> +--EXPECTF-- +done! +--UEXPECTF-- +Warning: mysql_set_charset(): Character set %s is not supported when running PHP with unicode.semantics=On. in %s on line %d +done! \ No newline at end of file