Skip to content

Commit

Permalink
Avoid deprecated DatePeriod constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jul 13, 2024
1 parent 3f031ae commit 21cc43c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/iterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,10 @@ public function testToIter() {
$this->assertSame([1, 2, 3], toArray($iter));

// DatePeriod is Traversable, but not Iterator or IteratorAggregate
$iter = toIter(new \DatePeriod('R2/2012-07-01T00:00:00Z/P7D'));
$iter = toIter(new \DatePeriod(
new \DateTime('2012-07-01T00:00:00'),
new \DateInterval('P7D'),
2));
$this->assertInstanceOf('Iterator', $iter);
$this->assertSame(
['2012-07-01', '2012-07-08', '2012-07-15'],
Expand Down

0 comments on commit 21cc43c

Please sign in to comment.