Пример #1
0
 public function testSetter()
 {
     $Split = new Split();
     $this->assertTrue($Split->isEmpty());
     $this->assertTrue($Split->isActive());
     $Split->setDistance(1.0);
     $Split->setTime(300);
     $Split->setResting();
     $this->assertFalse($Split->isEmpty());
     $this->assertEquals(1.0, $Split->distance());
     $this->assertEquals(300, $Split->time());
     $this->assertFalse($Split->isActive());
 }
Пример #2
0
 public function testActiveAndInactiveFlags()
 {
     $Split1 = new Split(1.0, 300, false);
     $Split2 = new Split(1.0, 300, false);
     $Splits = new Object(array($Split1, $Split2));
     $this->assertFalse($Splits->hasActiveAndInactiveLaps());
     $this->assertFalse($Splits->hasActiveLaps());
     $Split1->setResting(false);
     $this->assertTrue($Splits->hasActiveAndInactiveLaps());
     $this->assertTrue($Splits->hasActiveLaps());
     $this->assertFalse($Splits->hasActiveLaps(2));
     $Split2->setResting(false);
     $this->assertTrue($Splits->hasActiveLaps(2));
 }