Esempio n. 1
0
 /**
  * @param Pause $pause
  * @return bool
  */
 public function isOverlapping(Pause $pause)
 {
     if ($this->getEnd() <= $pause->getStart()) {
         return false;
     }
     if ($this->getStart() >= $pause->getEnd()) {
         return false;
     }
     return true;
 }
Esempio n. 2
0
 public function testArray()
 {
     $array = array(Pause::TIME => 60, Pause::DURATION => 10, Pause::HR_START => 120, Pause::HR_END => 100);
     $P = new Pause();
     $P->fromArray($array);
     $this->assertEquals(60, $P->time());
     $this->assertEquals(10, $P->duration());
     $this->assertTrue($P->hasHeartRateInfo());
     $this->assertEquals(120, $P->hrStart());
     $this->assertEquals(100, $P->hrEnd());
     $this->assertEquals(20, $P->hrDiff());
     $this->assertEquals($array, $P->asArray());
 }
Esempio n. 3
0
 public function testPauseBadAppend()
 {
     $this->setExpectedException('TwilioException');
     $r = new Pause();
     $r->append(new Dial());
 }
Esempio n. 4
0
 /**
  * @param Pause $pause
  * @return bool
  */
 private function isPauseOverlapping(Pause $pause)
 {
     $existingPauseList = $this->getPauseList();
     foreach ($existingPauseList as $existingPause) {
         if ($pause->isOverlapping($existingPause)) {
             return true;
         }
     }
     return false;
 }