1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 21:11:02 +02:00
Files
archived-php-src/ext/standard/tests/strings/chr_error.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

37 lines
859 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";
}
?>
--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