From 3659eb1542270d25c36fb3f38600e85cb8b6a22b Mon Sep 17 00:00:00 2001 From: kkadosh Date: Mon, 19 Mar 2018 16:13:31 +0000 Subject: Add a failing test for callback function as parameter --- ...g_disabled_functions_callback_called_file_r.ini | 1 + .../disabled_functions_callback_called_file_r.phpt | 40 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/tests/config/config_disabled_functions_callback_called_file_r.ini create mode 100644 src/tests/disabled_functions_callback_called_file_r.phpt (limited to 'src/tests') diff --git a/src/tests/config/config_disabled_functions_callback_called_file_r.ini b/src/tests/config/config_disabled_functions_callback_called_file_r.ini new file mode 100644 index 0000000..b076585 --- /dev/null +++ b/src/tests/config/config_disabled_functions_callback_called_file_r.ini @@ -0,0 +1 @@ +sp.disable_function.function("test_callback").filename_r("file_r\\.php$").drop(); \ No newline at end of file diff --git a/src/tests/disabled_functions_callback_called_file_r.phpt b/src/tests/disabled_functions_callback_called_file_r.phpt new file mode 100644 index 0000000..e1740c5 --- /dev/null +++ b/src/tests/disabled_functions_callback_called_file_r.phpt @@ -0,0 +1,40 @@ +--TEST-- +Disable functions by matching on the filename_r where the callback function is called, and not defined +--SKIPIF-- + +--INI-- +sp.configuration_file={PWD}/config/config_disabled_functions_callback_called_file_r.ini +--FILE-- + +EOD; + +file_put_contents("$dir/myfunc_callback.php", $mycode); + +include "$dir/myfunc_callback.php"; + +echo test('test_callback'); + +?> +--EXPECTF-- +[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'test_callback' in %a/disabled_functions_callback__called_file_r.php:%d has been disabled. +--XFAIL-- +--CLEAN-- + \ No newline at end of file -- cgit v1.3