1
0
mirror of https://github.com/php/php-src.git synced 2026-03-25 16:52:18 +01:00
Files
archived-php-src/ext/mbstring/tests/mb_strtoupper_error2.phpt
Nikita Popov a06d015e61 Remove unnecessary mbstring skipifs
These functions are always available (if the extension is available
at all).
2021-06-14 15:27:28 +02:00

26 lines
634 B
PHP

--TEST--
Test mb_strtoupper() function : error conditions - pass an unknown encoding
--EXTENSIONS--
mbstring
--FILE--
<?php
/*
* Pass an unknown encoding as $encoding argument to check behaviour of mbstrtoupper()
*/
echo "*** Testing mb_strtoupper() : error conditions ***\n";
$sourcestring = 'hello, world';
$encoding = 'unknown-encoding';
try {
var_dump( mb_strtoupper($sourcestring, $encoding) );
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
*** Testing mb_strtoupper() : error conditions ***
mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "unknown-encoding" given