1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 12:13:02 +02:00
Files
archived-php-src/ext/standard/tests/strings/chr_error.phpt
Gabriel Caruso 0cc63b9d2d Fix tests related to 714d9fc358
Some changes did not get into master during merge conflits.
2019-05-19 07:25:56 -03:00

39 lines
881 B
PHP

--TEST--
Test chr() function : error conditions
--FILE--
<?php
/* Prototype : string chr ( int $ascii )
* Description: Return a specific character
* Source code: ext/standard/string.c
*/
echo "*** Testing chr() : error conditions ***\n";
echo "\n-- Testing chr() function with no arguments --\n";
try {
var_dump( chr() );
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
echo "\n-- Testing chr() function with more than expected no. of arguments --\n";
$extra_arg = 10;
try {
var_dump( chr(72, $extra_arg) );
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
===DONE===
--EXPECTF--
*** Testing chr() : error conditions ***
-- Testing chr() function with no arguments --
chr() expects exactly 1 parameter, 0 given
-- Testing chr() function with more than expected no. of arguments --
chr() expects exactly 1 parameter, 2 given
===DONE===