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