1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 17:08:14 +02:00

Added test cases for new functionality

This commit is contained in:
Moriyoshi Koizumi
2003-03-24 19:21:20 +00:00
parent 93b250f923
commit 68b03bde3a
2 changed files with 45 additions and 0 deletions
@@ -0,0 +1,22 @@
--TEST--
htmlentities() test 15 (setlocale / KOI8-R)
--INI--
output_handler=
default_charset=
mbstring.internal_encoding=none
--SKIPIF--
<?php
$result = (bool)setlocale(LC_CTYPE, "ru_RU.koi8r");
if (!$result || preg_match('/koi8/i', setlocale(LC_CTYPE, 0)) == 0) {
die("skip setlocale() failed\n");
}
?>
--FILE--
<?php
setlocale(LC_CTYPE, "ru_RU.koi8r");
$str = "ÒÏÓËÏÛÎÙÊ";
var_dump($str, htmlentities($str, ENT_QUOTES, ''));
?>
--EXPECT--
string(9) "ÒÏÓËÏÛÎÙÊ"
string(63) "&#1088;&#1086;&#1089;&#1082;&#1086;&#1096;&#1085;&#1099;&#1081;"
@@ -0,0 +1,23 @@
--TEST--
htmlentities() test 16 (mbstring / cp1251)
--INI--
output_handler=
--SKIPIF--
<?php
extension_loaded("mbstring") or die("skip mbstring not available\n");
mb_internal_encoding('cp1251');
$php_errormsg = NULL;
@htmlentities("\x88\xa9\xd2\xcf\xd3\xcb\xcf\xdb\xce\xd9\xca", ENT_QUOTES, '');
if ($php_errormsg) {
die("skip cp1251 chracter set is not supported on this platform.\n");
}
?>
--FILE--
<?php
mb_internal_encoding('cp1251');
$str = "\x88\xa9\xf0\xee\xf1\xea\xee\xf8\xed\xfb\xe9";
var_dump($str, htmlentities($str, ENT_QUOTES, ''));
?>
--EXPECT--
string(11) "ˆ©ÒÏÓËÏÛÎÙÊ"
string(63) "&euro;&copy;&#1088;&#1086;&#1089;&#1082;&#1086;&#1096;&#1085;&#1099;&#1081;"