summaryrefslogtreecommitdiff
path: root/ext/date/tests
diff options
context:
space:
mode:
authorDerick Rethans <github@derickrethans.nl>2019-03-17 14:38:11 -0400
committerDerick Rethans <github@derickrethans.nl>2019-03-17 14:38:11 -0400
commit0325e78f4f786e927e926299380fac6fd10bc6c4 (patch)
tree6e7d74ab36718de422d4a06c147c63bb260085d9 /ext/date/tests
parent33d428252699b679e420d414507fb0c5db4b3eac (diff)
parent7e7ef44fab154e972a4677c579e73cb9ec175511 (diff)
downloadphp-git-0325e78f4f786e927e926299380fac6fd10bc6c4.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
Diffstat (limited to 'ext/date/tests')
-rw-r--r--ext/date/tests/DatePeriod_getter.phpt16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/date/tests/DatePeriod_getter.phpt b/ext/date/tests/DatePeriod_getter.phpt
index cd02bafd55..06fa031640 100644
--- a/ext/date/tests/DatePeriod_getter.phpt
+++ b/ext/date/tests/DatePeriod_getter.phpt
@@ -8,6 +8,7 @@ $start = new DateTime('2000-01-01 00:00:00', new DateTimeZone('Europe/Berlin'));
$end = new DateTime('2000-01-31 00:00:00', new DateTimeZone('UTC'));
$interval = new DateInterval('P1D');
$period = new DatePeriod($start, $interval, $end);
+$recurrences = 4;
var_dump($period->getStartDate()->format('Y-m-d H:i:s'));
var_dump($period->getStartDate()->getTimeZone()->getName());
@@ -16,6 +17,17 @@ var_dump($period->getEndDate()->format('Y-m-d H:i:s'));
var_dump($period->getEndDate()->getTimeZone()->getName());
var_dump($period->getDateInterval()->format('%R%y-%m-%d-%h-%i-%s'));
+var_dump($period->getRecurrences());
+
+$periodWithRecurrences = new DatePeriod($start, $interval, $recurrences);
+
+var_dump($periodWithRecurrences->getRecurrences());
+var_dump($periodWithRecurrences->getEndDate());
+
+$periodWithRecurrencesWithoutStart = new DatePeriod($start, $interval, $recurrences, DatePeriod::EXCLUDE_START_DATE);
+
+var_dump($periodWithRecurrences->getRecurrences());
+
?>
--EXPECT--
string(19) "2000-01-01 00:00:00"
@@ -23,3 +35,7 @@ string(13) "Europe/Berlin"
string(19) "2000-01-31 00:00:00"
string(3) "UTC"
string(12) "+0-0-1-0-0-0"
+NULL
+int(4)
+NULL
+int(4)