summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjvoisin2018-01-04 14:28:17 +0100
committerjvoisin2018-01-04 14:28:17 +0100
commit84e423300c440e96c34ada2620e0f78f827592e8 (patch)
tree77ca881861c99c619c98a16c91ae6c47e85f1127 /src
parentbc55f1ccd1c995f7ab502323c96f5a44352a5a80 (diff)
Bump a bit the coverage
Diffstat (limited to 'src')
-rw-r--r--src/tests/config/disabled_functions_ret_type_null.ini1
-rw-r--r--src/tests/disabled_functions_ret_type_null.phpt16
2 files changed, 17 insertions, 0 deletions
diff --git a/src/tests/config/disabled_functions_ret_type_null.ini b/src/tests/config/disabled_functions_ret_type_null.ini
new file mode 100644
index 0000000..70c4d69
--- /dev/null
+++ b/src/tests/config/disabled_functions_ret_type_null.ini
@@ -0,0 +1 @@
sp.disable_function.function("my_function").ret_type("null").drop().alias("Return value is null");
diff --git a/src/tests/disabled_functions_ret_type_null.phpt b/src/tests/disabled_functions_ret_type_null.phpt
new file mode 100644
index 0000000..1431d3a
--- /dev/null
+++ b/src/tests/disabled_functions_ret_type_null.phpt
@@ -0,0 +1,16 @@
1--TEST--
2Disable functions check on `ret` by type matching (null).
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/disabled_functions_ret_type_null.ini
7--FILE--
8<?php
9function my_function() {
10 return NULL;
11}
12
13var_dump(my_function());
14?>
15--EXPECTF--
16[snuffleupagus][0.0.0.0][disabled_function][drop] The execution has been aborted in %atests/disabled_functions_ret_type_null.php:6, because the function 'my_function' returned 'NULL', which matched the rule 'Return value is null'.