php-src/ext/mbstring/tests/mb_regex_encoding_error2.phpt
Nikita Popov 39131219e8
Migrate more SKIPIF -> EXTENSIONS (#7139)
This is a mix of more automated and manual migration. It should remove all applicable extension_loaded() checks outside of skipif.inc files.
2021-06-11 12:58:44 +02:00

26 lines
654 B
PHP

--TEST--
Test mb_regex_encoding() function : error conditions - Pass an unknown encoding
--EXTENSIONS--
mbstring
--SKIPIF--
<?php
function_exists('mb_regex_encoding') or die("skip mb_regex_encoding() is not available in this build");
?>
--FILE--
<?php
/*
* Pass mb_regex_encoding an unknown type of encoding
*/
echo "*** Testing mb_regex_encoding() : error conditions ***\n";
try {
var_dump(mb_regex_encoding('unknown'));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
*** Testing mb_regex_encoding() : error conditions ***
mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "unknown" given