1--TEST--
2Test mb_strtoupper() function : error conditions - pass an unknown encoding
3--SKIPIF--
4<?php
5extension_loaded('mbstring') or die('skip');
6function_exists('mb_strtoupper') or die("skip mb_strtoupper() is not available in this build");
7?>
8--FILE--
9<?php
10/*
11 * Pass an unknown encoding as $encoding argument to check behaviour of mbstrtoupper()
12 */
13
14echo "*** Testing mb_strtoupper() : error conditions ***\n";
15
16$sourcestring = 'hello, world';
17$encoding = 'unknown-encoding';
18
19try {
20    var_dump( mb_strtoupper($sourcestring, $encoding) );
21} catch (\ValueError $e) {
22    echo $e->getMessage() . \PHP_EOL;
23}
24
25?>
26--EXPECT--
27*** Testing mb_strtoupper() : error conditions ***
28mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "unknown-encoding" given
29