1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 13:01:02 +02:00
Files
archived-php-src/ext/readline/tests/libedit_callback_handler_install_001.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

29 lines
705 B
PHP

--TEST--
readline_callback_handler_install(): Basic test
--EXTENSIONS--
readline
--SKIPIF--
<?php if (!function_exists('readline_callback_handler_install')) die("skip");
if (READLINE_LIB != "libedit") die("skip libedit only");
?>
--INI--
zend.signal_check=0
--FILE--
<?php
function foo() {
readline_callback_handler_remove();
}
var_dump(readline_callback_handler_install('testing: ', 'foo'));
try {
var_dump(readline_callback_handler_install('testing: ', 'foobar!'));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
readline_callback_handler_install(): Argument #2 ($callback) must be a valid callback, function "foobar!" not found or invalid function name