コード例 #1
0
ファイル: WeightUnitTest.php プロジェクト: 9x/Runalyze
 public function testStones()
 {
     $this->object->set(WeightUnit::STONES);
     $this->assertFalse($this->object->isKG());
     $this->assertFalse($this->object->isPounds());
     $this->assertTrue($this->object->isStones());
 }
コード例 #2
0
ファイル: Weight.php プロジェクト: guancio/Runalyze
 /**
  * @return float [mixed unit]
  */
 public function valueInPreferredUnit()
 {
     if ($this->PreferredUnit->isPounds()) {
         return $this->pounds();
     } elseif ($this->PreferredUnit->isStones()) {
         return $this->stones();
     }
     return $this->kg();
 }