Skip to content

Commit dfca0e5

Browse files
committed
Ensure the public properties of DatePeriod are available
Although these properties are not currently documented, they've been publically available so we should ensure they remain so
1 parent 3d0a0f8 commit dfca0e5

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--TEST--
2+
DatePeriod: Test read only properties
3+
--INI--
4+
date.timezone=UTC
5+
--FILE--
6+
<?php
7+
8+
$start = new DateTime;
9+
$interval = new DateInterval('P1D');
10+
$end = new DateTime;
11+
$period = new DatePeriod($start, $interval, $end);
12+
13+
echo "recurrences: ";
14+
var_dump($period->recurrences);
15+
16+
echo "include_start_date: ";
17+
var_dump($period->include_start_date);
18+
19+
echo "start: ";
20+
var_dump($period->start == $start);
21+
22+
echo "current: ";
23+
var_dump($period->current);
24+
25+
echo "end: ";
26+
var_dump($period->end == $end);
27+
28+
echo "interval: ";
29+
var_dump($period->interval == $interval);
30+
?>
31+
--EXPECT--
32+
recurrences: int(1)
33+
include_start_date: bool(true)
34+
start: bool(true)
35+
current: NULL
36+
end: bool(true)
37+
interval: bool(true)

0 commit comments

Comments
 (0)