Author: Márk Sági-Kazár (mark.sagikazar@gmail.com)
Inheritance: implements Serializable
Beispiel #1
0
 public function testAddHolidays()
 {
     $holiday = new \DateTime('2015-05-11');
     $holidayRange = new DateRange(new \DateTime('2015-07-08'), new \DateTime('2015-07-21'));
     $holidays = new Holidays();
     $holidays->addHolidays([$holiday]);
     $holidays->addHolidays($holidayRange);
     $this->assertTrue($holidays->isHoliday($holiday));
     $this->assertTrue($holidays->isHoliday(new \DateTime('2015-07-09 10:00')));
 }
Beispiel #2
0
 public function testIsHoliday()
 {
     $holidays = new Holidays([$holiday = new \DateTime('2015-05-11'), new DateTimePeriod(new \DateTime('2015-07-08'), new \DateTime('2015-07-21'))]);
     $this->assertTrue($holidays->isHoliday($holiday));
     $this->assertTrue($holidays->isHoliday(new \DateTime('2015-07-09 10:00')));
 }