Beispiel #1
0
 /**
  * @covers Mce\Date\Range\Inclusive::contains
  *
  * @author Matthew Conger-Eldeen <*****@*****.**>
  */
 public function testContains()
 {
     $start = new DateTime("2012-01-01 00:00:00");
     $middle = new DateTime("2012-01-15 12:00:00");
     $end = new DateTime("2012-01-31 23:59:59");
     $before = clone $start;
     $before->sub(new DateInterval("PT1S"));
     $after = clone $end;
     $after->add(new DateInterval("PT1S"));
     $range = new Range($start, $end);
     $this->assertTrue($range->contains($start));
     $this->assertTrue($range->contains($middle));
     $this->assertTrue($range->contains($end));
     $this->assertFalse($range->contains($before));
     $this->assertFalse($range->contains($after));
 }