diff options
| author | jvoisin | 2026-03-25 21:27:09 +0100 |
|---|---|---|
| committer | jvoisin | 2026-03-25 21:27:52 +0100 |
| commit | 0b79579c25a43be7e5918841f1d2ad8c297235ac (patch) | |
| tree | 87b4d7e4460d7e17743288d4a80086d9f62fc7d9 | |
| parent | 9bbb7affb5f23e4d52da0da159229956049e3cfd (diff) | |
Add a test for Dateinterval::__construct
As it has been privately reported that the rule might not be working, so better
safe than sorry. Moreover, we didn't have tests for `__construct`
| -rw-r--r-- | src/tests/config/DateInterval.ini | 1 | ||||
| -rw-r--r-- | src/tests/regressions/dateinterval.phpt | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/tests/config/DateInterval.ini b/src/tests/config/DateInterval.ini new file mode 100644 index 0000000..db1c0d2 --- /dev/null +++ b/src/tests/config/DateInterval.ini | |||
| @@ -0,0 +1 @@ | |||
| sp.disable_function.function("DateInterval::__construct").drop().simulation(); | |||
diff --git a/src/tests/regressions/dateinterval.phpt b/src/tests/regressions/dateinterval.phpt new file mode 100644 index 0000000..f4abdcc --- /dev/null +++ b/src/tests/regressions/dateinterval.phpt | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | --TEST-- | ||
| 2 | Test for DateInterval | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) print("skip"); ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/../config/DateInterval.ini | ||
| 7 | --FILE-- | ||
| 8 | <?php | ||
| 9 | $a = new DateInterval('PT0S'); | ||
| 10 | echo "ok"; | ||
| 11 | ?> | ||
| 12 | --EXPECTF-- | ||
| 13 | Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'DateInterval::__construct' in %s/tests/regressions/dateinterval.php on line 2 | ||
| 14 | ok | ||
| 15 | |||
