Skip to content

Commit

Permalink
Add an unit test for an edge-case
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoisin committed Mar 9, 2018
1 parent 9f8293d commit 1b0f8a4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sp.disable_function.function("my_func").drop();
18 changes: 18 additions & 0 deletions src/tests/disabled_functions_eval_user.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Disable functions - eval with a disabled user func
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/config_disabled_functions_eval_user_func.ini
--FILE--
<?php
function my_func() {
echo "1337\n";
return 10;
}
$a = 0;
eval('$a = my_func();');
echo '$a = ' . $a . "\n";
?>
--EXPECTF--
[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'my_func' in %a/tests/disabled_functions_eval_user.php:3 has been disabled.

0 comments on commit 1b0f8a4

Please sign in to comment.