diff options
Diffstat (limited to 'src/tests/disable_function')
9 files changed, 38 insertions, 57 deletions
diff --git a/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt b/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt index ec75d74..d977733 100644 --- a/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt +++ b/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt | |||
| @@ -30,10 +30,5 @@ include "$dir/myfunc_callback.php"; | |||
| 30 | echo test('test_callback'); | 30 | echo test('test_callback'); |
| 31 | 31 | ||
| 32 | ?> | 32 | ?> |
| 33 | --CLEAN-- | ||
| 34 | <?php | ||
| 35 | $dir = __DIR__; | ||
| 36 | @unlink("$dir/myfunc_callback.php"); | ||
| 37 | ?> | ||
| 38 | --EXPECTF-- | 33 | --EXPECTF-- |
| 39 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'test_callback' in %a/myfunc_callback.php on line 4 | 34 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'test_callback' in %a/myfunc_callback.php on line 4 |
diff --git a/src/tests/disable_function/disabled_functions_called_file_r.phpt b/src/tests/disable_function/disabled_functions_called_file_r.phpt index dde26f7..2ba06d4 100644 --- a/src/tests/disable_function/disabled_functions_called_file_r.phpt +++ b/src/tests/disable_function/disabled_functions_called_file_r.phpt | |||
| @@ -25,10 +25,5 @@ include "$dir/myfunc.php"; | |||
| 25 | test(); | 25 | test(); |
| 26 | 26 | ||
| 27 | ?> | 27 | ?> |
| 28 | --CLEAN-- | ||
| 29 | <?php | ||
| 30 | $dir = __DIR__; | ||
| 31 | @unlink("$dir/myfunc.php"); | ||
| 32 | ?> | ||
| 33 | --EXPECTF-- | 28 | --EXPECTF-- |
| 34 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'test' in %a/myfunc.php on line 3 | 29 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'test' in %a/myfunc.php on line 3 |
diff --git a/src/tests/disable_function/disabled_functions_include_once.phpt b/src/tests/disable_function/disabled_functions_include_once.phpt index 57cb5a1..8b1bec8 100644 --- a/src/tests/disable_function/disabled_functions_include_once.phpt +++ b/src/tests/disable_function/disabled_functions_include_once.phpt | |||
| @@ -7,21 +7,20 @@ sp.configuration_file={PWD}/config/config_disabled_functions_include.ini | |||
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | <?php | 8 | <?php |
| 9 | $dir = __DIR__; | 9 | $dir = __DIR__; |
| 10 | |||
| 11 | // Just inc ase | ||
| 12 | @unlink($dir . '/test.bla'); | ||
| 13 | @unlink($dir . '/test.sim'); | ||
| 14 | |||
| 10 | file_put_contents($dir . '/test.bla', "BLA\n"); | 15 | file_put_contents($dir . '/test.bla', "BLA\n"); |
| 11 | file_put_contents($dir . '/test.sim', "MEH\n"); | 16 | file_put_contents($dir . '/test.sim', "MEH\n"); |
| 12 | include_once $dir . '/test.bla'; | 17 | include_once $dir . '/test.bla'; |
| 13 | include_once $dir . '/test.sim'; | 18 | include_once $dir . '/test.sim'; |
| 14 | echo "1337\n"; | 19 | echo "1337\n"; |
| 15 | ?> | 20 | ?> |
| 16 | --CLEAN-- | ||
| 17 | <?php | ||
| 18 | $dir = __DIR__; | ||
| 19 | unlink($dir . '/test.bla'); | ||
| 20 | unlink($dir . '/test.sim'); | ||
| 21 | ?> | ||
| 22 | --EXPECTF-- | 21 | --EXPECTF-- |
| 23 | BLA | 22 | BLA |
| 24 | 23 | ||
| 25 | Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'include_once', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_include_once.php on line 6 | 24 | Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'include_once', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_include_once.php on line %d |
| 26 | MEH | 25 | MEH |
| 27 | 1337 | 26 | 1337 |
diff --git a/src/tests/disable_function/disabled_functions_include_simulation.phpt b/src/tests/disable_function/disabled_functions_include_simulation.phpt index 53ea2a4..cf2c693 100644 --- a/src/tests/disable_function/disabled_functions_include_simulation.phpt +++ b/src/tests/disable_function/disabled_functions_include_simulation.phpt | |||
| @@ -7,21 +7,20 @@ sp.configuration_file={PWD}/config/config_disabled_functions_include.ini | |||
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | <?php | 8 | <?php |
| 9 | $dir = __DIR__; | 9 | $dir = __DIR__; |
| 10 | |||
| 11 | // Just in case | ||
| 12 | @unlink($dir . '/test.bla'); | ||
| 13 | @unlink($dir . '/test.sim'); | ||
| 14 | |||
| 10 | file_put_contents($dir . '/test.bla', "BLA\n"); | 15 | file_put_contents($dir . '/test.bla', "BLA\n"); |
| 11 | file_put_contents($dir . '/test.sim', "MEH\n"); | 16 | file_put_contents($dir . '/test.sim', "MEH\n"); |
| 12 | include $dir . '/test.bla'; | 17 | include $dir . '/test.bla'; |
| 13 | include $dir . '/test.sim'; | 18 | include $dir . '/test.sim'; |
| 14 | echo "1337\n"; | 19 | echo "1337\n"; |
| 15 | ?> | 20 | ?> |
| 16 | --CLEAN-- | ||
| 17 | <?php | ||
| 18 | $dir = __DIR__; | ||
| 19 | unlink($dir . '/test.bla'); | ||
| 20 | unlink($dir . '/test.sim'); | ||
| 21 | ?> | ||
| 22 | --EXPECTF-- | 21 | --EXPECTF-- |
| 23 | BLA | 22 | BLA |
| 24 | 23 | ||
| 25 | Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'include', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_include_simulation.php on line 6 | 24 | Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'include', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_include_simulation.php on line %d |
| 26 | MEH | 25 | MEH |
| 27 | 1337 | 26 | 1337 |
diff --git a/src/tests/disable_function/disabled_functions_require.phpt b/src/tests/disable_function/disabled_functions_require.phpt index df2b2f0..bf59b58 100644 --- a/src/tests/disable_function/disabled_functions_require.phpt +++ b/src/tests/disable_function/disabled_functions_require.phpt | |||
| @@ -7,18 +7,17 @@ sp.configuration_file={PWD}/config/config_disabled_functions_require.ini | |||
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | <?php | 8 | <?php |
| 9 | $dir = __DIR__; | 9 | $dir = __DIR__; |
| 10 | |||
| 11 | // Just in case | ||
| 12 | @unlink($dir . '/test.bla'); | ||
| 13 | @unlink($dir . '/test.meh'); | ||
| 14 | |||
| 10 | file_put_contents($dir . '/test.bla', "BLA"); | 15 | file_put_contents($dir . '/test.bla', "BLA"); |
| 11 | file_put_contents($dir . '/test.meh', "MEH"); | 16 | file_put_contents($dir . '/test.meh', "MEH"); |
| 12 | require $dir . '/test.bla'; | 17 | require $dir . '/test.bla'; |
| 13 | require $dir . '/test.meh'; | 18 | require $dir . '/test.meh'; |
| 14 | echo "1337"; | 19 | echo "1337"; |
| 15 | ?> | 20 | ?> |
| 16 | --CLEAN-- | ||
| 17 | <?php | ||
| 18 | $dir = __DIR__; | ||
| 19 | unlink($dir . '/test.bla'); | ||
| 20 | unlink($dir . '/test.meh'); | ||
| 21 | ?> | ||
| 22 | --EXPECTF-- | 21 | --EXPECTF-- |
| 23 | BLA | 22 | BLA |
| 24 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'require', because its argument 'inclusion path' content (%a/test.meh) matched a rule in %a/disabled_functions_require.php on line 6 | 23 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'require', because its argument 'inclusion path' content (%a/test.meh) matched a rule in %a/disabled_functions_require.php on line %d |
diff --git a/src/tests/disable_function/disabled_functions_require_allow.phpt b/src/tests/disable_function/disabled_functions_require_allow.phpt index 7ab29aa..37a7e33 100644 --- a/src/tests/disable_function/disabled_functions_require_allow.phpt +++ b/src/tests/disable_function/disabled_functions_require_allow.phpt | |||
| @@ -7,6 +7,11 @@ sp.configuration_file={PWD}/config/config_disabled_functions_require_allow.ini | |||
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | <?php | 8 | <?php |
| 9 | $dir = __DIR__; | 9 | $dir = __DIR__; |
| 10 | |||
| 11 | // Just in case | ||
| 12 | unlink($dir . '/test.bla'); | ||
| 13 | unlink($dir . '/test.meh'); | ||
| 14 | |||
| 10 | file_put_contents($dir . '/test.bla', "BLA\n"); | 15 | file_put_contents($dir . '/test.bla', "BLA\n"); |
| 11 | file_put_contents($dir . '/test.meh', "MEH\n"); | 16 | file_put_contents($dir . '/test.meh', "MEH\n"); |
| 12 | require $dir . '/test.bla'; | 17 | require $dir . '/test.bla'; |
| @@ -17,9 +22,3 @@ echo "1337"; | |||
| 17 | BLA | 22 | BLA |
| 18 | MEH | 23 | MEH |
| 19 | 1337 | 24 | 1337 |
| 20 | --CLEAN-- | ||
| 21 | <?php | ||
| 22 | $dir = __DIR__; | ||
| 23 | unlink($dir . '/test.bla'); | ||
| 24 | unlink($dir . '/test.meh'); | ||
| 25 | ?> | ||
diff --git a/src/tests/disable_function/disabled_functions_require_once.phpt b/src/tests/disable_function/disabled_functions_require_once.phpt index 7356c08..81049ef 100644 --- a/src/tests/disable_function/disabled_functions_require_once.phpt +++ b/src/tests/disable_function/disabled_functions_require_once.phpt | |||
| @@ -7,18 +7,16 @@ sp.configuration_file={PWD}/config/config_disabled_functions_require.ini | |||
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | <?php | 8 | <?php |
| 9 | $dir = __DIR__; | 9 | $dir = __DIR__; |
| 10 | // Just in case | ||
| 11 | unlink($dir . '/test.bla'); | ||
| 12 | unlink($dir . '/test.meh'); | ||
| 13 | |||
| 10 | file_put_contents($dir . '/test.bla', "BLA"); | 14 | file_put_contents($dir . '/test.bla', "BLA"); |
| 11 | file_put_contents($dir . '/test.meh', "MEH"); | 15 | file_put_contents($dir . '/test.meh', "MEH"); |
| 12 | require_once $dir . '/test.bla'; | 16 | require_once $dir . '/test.bla'; |
| 13 | require_once $dir . '/test.meh'; | 17 | require_once $dir . '/test.meh'; |
| 14 | echo "1337"; | 18 | echo "1337"; |
| 15 | ?> | 19 | ?> |
| 16 | --CLEAN-- | ||
| 17 | <?php | ||
| 18 | $dir = __DIR__; | ||
| 19 | unlink($dir . '/test.bla'); | ||
| 20 | unlink($dir . '/test.meh'); | ||
| 21 | ?> | ||
| 22 | --EXPECTF-- | 20 | --EXPECTF-- |
| 23 | BLA | 21 | BLA |
| 24 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'require_once', because its argument 'inclusion path' content (%a/test.meh) matched a rule in %a/disabled_functions_require_once.php on line 6 | 22 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'require_once', because its argument 'inclusion path' content (%a/test.meh) matched a rule in %a/disabled_functions_require_once.php on line %d |
diff --git a/src/tests/disable_function/disabled_functions_require_simulation.phpt b/src/tests/disable_function/disabled_functions_require_simulation.phpt index fa1523c..2c52610 100644 --- a/src/tests/disable_function/disabled_functions_require_simulation.phpt +++ b/src/tests/disable_function/disabled_functions_require_simulation.phpt | |||
| @@ -7,21 +7,19 @@ sp.configuration_file={PWD}/config/config_disabled_functions_require.ini | |||
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | <?php | 8 | <?php |
| 9 | $dir = __DIR__; | 9 | $dir = __DIR__; |
| 10 | // Just in case | ||
| 11 | @unlink($dir . '/test.bla'); | ||
| 12 | @unlink($dir . '/test.sim'); | ||
| 13 | |||
| 10 | file_put_contents($dir . '/test.bla', "BLA\n"); | 14 | file_put_contents($dir . '/test.bla', "BLA\n"); |
| 11 | file_put_contents($dir . '/test.sim', "MEH\n"); | 15 | file_put_contents($dir . '/test.sim', "MEH\n"); |
| 12 | require $dir . '/test.bla'; | 16 | require $dir . '/test.bla'; |
| 13 | require $dir . '/test.sim'; | 17 | require $dir . '/test.sim'; |
| 14 | echo "1337\n"; | 18 | echo "1337\n"; |
| 15 | ?> | 19 | ?> |
| 16 | --CLEAN-- | ||
| 17 | <?php | ||
| 18 | $dir = __DIR__; | ||
| 19 | unlink($dir . '/test.bla'); | ||
| 20 | unlink($dir . '/test.sim'); | ||
| 21 | ?> | ||
| 22 | --EXPECTF-- | 20 | --EXPECTF-- |
| 23 | BLA | 21 | BLA |
| 24 | 22 | ||
| 25 | Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'require', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_require_simulation.php on line 6 | 23 | Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'require', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_require_simulation.php on line %d |
| 26 | MEH | 24 | MEH |
| 27 | 1337 | 25 | 1337 |
diff --git a/src/tests/disable_function/disabled_functions_runtime.phpt b/src/tests/disable_function/disabled_functions_runtime.phpt index 16ecfdb..8175a77 100644 --- a/src/tests/disable_function/disabled_functions_runtime.phpt +++ b/src/tests/disable_function/disabled_functions_runtime.phpt | |||
| @@ -6,8 +6,12 @@ Disable functions - runtime inclusion | |||
| 6 | sp.configuration_file={PWD}/config/config_disabled_functions_param_runtime.ini | 6 | sp.configuration_file={PWD}/config/config_disabled_functions_param_runtime.ini |
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | <?php | 8 | <?php |
| 9 | |||
| 10 | $dir = __DIR__; | 9 | $dir = __DIR__; |
| 10 | |||
| 11 | // Just in case | ||
| 12 | @unlink("file_to_include1.php"); | ||
| 13 | @unlink("file_to_include2.php"); | ||
| 14 | |||
| 11 | $content = '<?php function test($param) { echo $param . "\n"; }'; | 15 | $content = '<?php function test($param) { echo $param . "\n"; }'; |
| 12 | file_put_contents('file_to_include1.php', $content); | 16 | file_put_contents('file_to_include1.php', $content); |
| 13 | file_put_contents('file_to_include2.php', $content); | 17 | file_put_contents('file_to_include2.php', $content); |
| @@ -21,11 +25,6 @@ if (rand() % 2) { | |||
| 21 | test('1338');test('1337'); | 25 | test('1338');test('1337'); |
| 22 | 26 | ||
| 23 | ?> | 27 | ?> |
| 24 | --CLEAN-- | ||
| 25 | <?php | ||
| 26 | unlink("file_to_include1.php"); | ||
| 27 | unlink("file_to_include2.php"); | ||
| 28 | ?> | ||
| 29 | --EXPECTF-- | 28 | --EXPECTF-- |
| 30 | 1338 | 29 | 1338 |
| 31 | 30 | ||
