Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. <?php
  2.  
  3. public function testInterval()
  4. {
  5. $date = new DateTime('+1 month');
  6.  
  7. $date->add(\DateInterval::createFromDateString('3 months'));
  8.  
  9. // Tested on 2016-08-31
  10. // Failed asserting that two DateTime objects are equal.
  11. // Expected :2016-12-31T14:28:49+0000
  12. // Actual :2017-01-01T14:28:49+0000
  13. static::assertEquals(new DateTime('+4 months'), $date);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement