public function testDiffFilteredNegativeNoSignWithMutated() { $dt = Date::createFromDate(2000, 1, 31); $this->assertSame(2, $dt->diffFiltered(Interval::days(2), function (Date $date) { return $date->getDayOfWeek() === Date::SUNDAY; }, $dt->copy()->startOfMonth())); }
public function testFluentSettersWeeksOverwritesDays() { $ci = Interval::days(5)->weeks(3); $this->assertInterval($ci, 0, 0, 3 * 7, 0, 0, 0); }
public function testDays() { $ci = new Interval(0, 0, 0, 1); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 1, 0, 0, 0); $ci = Interval::days(2); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 2, 0, 0, 0); $ci = Interval::dayz(2); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 2, 0, 0, 0); $ci = Interval::day(); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 1, 0, 0, 0); $ci = Interval::day(3); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 3, 0, 0, 0); }