From 011b7f9840b43d241c302d4b176ceb86ec911ead Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Wed, 19 Oct 2022 11:15:05 +0100 Subject: [PATCH] Test for bug #78055 (DatePeriod's getRecurrences and ->recurrences don't match) --- ext/date/tests/bug78055.phpt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ext/date/tests/bug78055.phpt diff --git a/ext/date/tests/bug78055.phpt b/ext/date/tests/bug78055.phpt new file mode 100644 index 00000000000..0ad252793f4 --- /dev/null +++ b/ext/date/tests/bug78055.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #78055 (DatePeriod's getRecurrences and ->recurrences don't match) +--FILE-- +getRecurrences(), " ", $period->recurrences, "\n"; + +$period = new DatePeriod($start, $interval, $recurrences); +echo $period->getRecurrences(), " ", $period->recurrences, "\n"; + +$period = new DatePeriod($start, $interval, $recurrences, DatePeriod::INCLUDE_END_DATE); +echo $period->getRecurrences(), " ", $period->recurrences, "\n"; + +$period = new DatePeriod($start, $interval, $end); +echo $period->getRecurrences(), " ", $period->recurrences, "\n"; + +$period = new DatePeriod($start, $interval, $end, DatePeriod::EXCLUDE_START_DATE); +echo $period->getRecurrences(), " ", $period->recurrences, "\n"; +?> +--EXPECT-- +5 5 +5 6 +5 7 + 1 + 0