php-src/ext/mbstring/tests/mb_substitute_character.phpt

50 lines
1.1 KiB
Plaintext
Raw Normal View History

2002-10-21 19:19:05 +00:00
--TEST--
mb_substitute_character()
--SKIPIF--
2002-10-30 08:06:52 +00:00
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
2002-10-21 19:19:05 +00:00
--FILE--
2002-03-02 10:44:57 +00:00
<?php
//$debug = true;
2008-07-17 16:30:32 +00:00
ini_set('include_path', dirname(__FILE__));
include_once('common.inc');
2002-03-02 10:44:57 +00:00
// Note: It does not return TRUE/FALSE for setting char
// Use Unicode val
$r = mb_substitute_character(0x3013);
//$r = mb_substitute_character('U+3013');
($r === TRUE) ? print "OK_UTF\n" : print("NG_UTF: ".gettype($r)." $r\n");
print mb_substitute_character() . "\n";
// Use "long"
$r = mb_substitute_character('long');
($r === TRUE) ? print "OK_LONG\n" : print("NG_LONG: ".gettype($r)." $r\n");
print mb_substitute_character() . "\n";
// Use "none"
$r = mb_substitute_character('none');
($r === TRUE) ? print "OK_NONE\n" : print("NG_NONE: ".gettype($r)." $r\n");
print mb_substitute_character() . "\n";
// Set invalid string. Should fail.
print "== INVALID PARAMETER ==\n";
$r = mb_substitute_character('BAD_NAME');
($r === FALSE) ? print "OK_BAD_NAME\n" : print("NG_BAD_NAME: ".gettype($r)." $r\n");
?>
2002-10-21 19:19:05 +00:00
--EXPECT--
OK_UTF
12307
OK_LONG
long
OK_NONE
none
== INVALID PARAMETER ==
ERR: Warning
OK_BAD_NAME