Esempio n. 1
0
 public function testIsActive()
 {
     $before = new DateTime('2016-01-06');
     $first = new DateTime('2016-01-07');
     $mid = new DateTime('2016-01-15');
     $last = new DateTime('2016-01-23');
     $after = new DateTime('2016-01-24');
     $holiday = new Holiday('Test Holiday', new DateTime('2016-01-07'), new DateTime('2016-01-23'));
     $this->assertFalse($holiday->isActive($before));
     $this->assertTrue($holiday->isActive($first));
     $this->assertTrue($holiday->isActive($mid));
     $this->assertTrue($holiday->isActive($last));
     $this->assertFalse($holiday->isActive($after));
 }