Example #1
0
 /**
  * Heart rate as string
  * @return string
  */
 public function string()
 {
     if ($this->PreferredUnit->isHRreserve() && $this->canShowInHRrest()) {
         return $this->asHRrest();
     } elseif ($this->PreferredUnit->isHRmax() && $this->canShowInHRmax()) {
         return $this->asHRmax();
     }
     return $this->asBPM();
 }
Example #2
0
 public function testValues()
 {
     $this->assertFalse($this->object->isBPM());
     $this->assertTrue($this->object->isHRmax());
     $this->assertFalse($this->object->isHRreserve());
     $this->object->set(HeartRateUnit::BPM);
     $this->assertTrue($this->object->isBPM());
     $this->assertFalse($this->object->isHRmax());
     $this->assertFalse($this->object->isHRreserve());
     $this->object->set(HeartRateUnit::HRRESERVE);
     $this->assertFalse($this->object->isBPM());
     $this->assertFalse($this->object->isHRmax());
     $this->assertTrue($this->object->isHRreserve());
 }