public function testDiffFilteredNegativeWithSignWithMutated() { $dt = Date::createFromDate(2000, 1, 31); $this->assertSame(-4, $dt->diffFiltered(Interval::week(), function (Date $date) { return $date->getMonth() === 12; }, $dt->copy()->subMonths(3), false)); }
public function testWeeks() { $ci = new Interval(0, 0, 1); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 7, 0, 0, 0); $ci = Interval::weeks(2); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 14, 0, 0, 0); $ci = Interval::week(); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 7, 0, 0, 0); $ci = Interval::week(3); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 21, 0, 0, 0); }