php-src/ext/mbstring/tests/mb_strtolower_error2.phpt
Josie Messa dcd8dff11b - Committing new tests for MBString extensions
- The tests listed in the following link will fail as they are adjusted
to expose bugs
(more details here: http://news.php.net/php.qa/62382)
2008-02-01 15:40:23 +00:00

43 lines
1.2 KiB
PHP

--TEST--
Test mb_strtolower() function : error conditions - pass an unknown encoding
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_strtolower') or die("skip mb_strtolower() is not available in this build");
?>
--FILE--
<?php
/* Prototype : string mb_strtolower(string $sourcestring [, string $encoding])
* Description: Returns a lowercased version of $sourcestring
* Source code: ext/mbstring/mbstring.c
*/
/*
* Pass an unknown encoding to mb_strtolower() to test behaviour
*/
echo "*** Testing mb_strtolower() : error conditions***\n";
$sourcestring = 'hello, world';
$encoding = 'unknown-encoding';
var_dump( mb_strtolower($sourcestring, $encoding) );
echo "Done";
?>
--EXPECTF--
*** Testing mb_strtolower() : error conditions***
Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d
Warning: mb_strtolower(): Unknown encoding "unknown-encoding" in %s on line %d
bool(false)
Done
--UEXPECTF--
*** Testing mb_strtolower() : error conditions***
Warning: mb_strtolower(): Illegal character encoding specified in %s on line %d
Warning: mb_strtolower(): Unknown encoding "unknown-encoding" in %s on line %d
bool(false)
Done