Example #1
0
 public function testIncludes()
 {
     $range = new Range(5, 10);
     $otherRange = new Range(6, 8);
     $this->assertTrue($range->includes($otherRange));
 }
Example #2
0
 /**
  * Checks whether the given <code>Range</code> overlaps this range
  * @param range
  * @return true if the given range overlaps this range
  */
 public function overlaps(Range $range)
 {
     return $range->contains($this->start) || $range->contains($this->end) || $this->includes($range);
 }