public function testDiffFilteredUsingMinutesPositiveWithMutated() { $dt = Date::createFromDate(2000, 1, 1)->startOfDay(); $this->assertSame(60, $dt->diffFiltered(Interval::minute(), function (Date $date) { return $date->getHour() === 12; }, Date::createFromDate(2000, 1, 1)->endOfDay())); }
public function testMinutes() { $ci = new Interval(0, 0, 0, 0, 0, 1); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 0, 0, 1, 0); $ci = Interval::minutes(2); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 0, 0, 2, 0); $ci = Interval::minute(); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 0, 0, 1, 0); $ci = Interval::minute(3); $this->assertInstanceOfInterval($ci); $this->assertInterval($ci, 0, 0, 0, 0, 3, 0); }