/** * @dataProvider provider */ public function testContains($date, $day, $assert) { $dotm = new DayOfTheMonth($day); $date = \DateTime::createFromFormat('Y-m-d H:i:s', $date); if ($assert) { $this->assertTrue($dotm->contains($date)); } else { $this->assertFalse($dotm->contains($date)); } }
/** * Whether the $datetime is * * @param DateTime $dateTime * * @return boolean */ protected function onMonthDays(DateTime $dateTime) { if (!$this->monthDays->count()) { return true; } $dotm = new DayOfTheMonth(); while ($this->monthDays->next()) { if ($dotm->setDay($this->monthDays->current())->contains($dateTime)) { return true; } } return false; }