Пример #1
0
 /**
  * Test: standard route
  * Filename: "Route-only.kml" 
  */
 public function testStandardKMLroute()
 {
     $this->object->parseFile('../tests/testfiles/kml/Route-only.kml');
     $this->assertFalse($this->object->hasMultipleTrainings());
     $this->assertFalse($this->object->failed());
     $this->assertEquals(0.4, $this->object->object()->getDistance(), '', 0.05);
     $this->assertTrue($this->object->object()->hasArrayAltitude());
     $this->assertTrue($this->object->object()->hasArrayDistance());
     $this->assertTrue($this->object->object()->hasArrayLatitude());
     $this->assertTrue($this->object->object()->hasArrayLongitude());
     $this->assertFalse($this->object->object()->hasArrayTime());
 }
 /**
  * Test: new format
  * Filename: "DatacenterVersion4-HM.slf" 
  */
 public function testVersion4File()
 {
     $this->object->parseFile('../tests/testfiles/slf/DatacenterVersion4-HM.slf');
     $this->assertFalse($this->object->hasMultipleTrainings());
     $this->assertFalse($this->object->failed());
     $this->assertEquals('29.03.2015 11:10:46', date('d.m.Y H:i:s', $this->object->object()->getTimestamp()));
     $this->assertEquals(5559, $this->object->object()->getTimeInSeconds());
     $this->assertEquals(20.88, $this->object->object()->getDistance(), '', 0.1);
     $this->assertEquals(1068, $this->object->object()->getCalories(), '', 10);
     $this->assertEquals(163, $this->object->object()->getPulseAvg(), '', 2);
     $this->assertEquals(169, $this->object->object()->getPulseMax(), '', 2);
     $this->assertEquals(14, count($this->object->object()->Splits()->distancesAsArray()));
 }
Пример #3
0
 /**
  * Test: new format
  * Filename: "DatacenterVersion4-HM.slf" 
  */
 public function testVersion4WithoutEntriesFile()
 {
     $this->object->parseFile('../tests/testfiles/slf/slf4-without-entries-.slf');
     $this->assertFalse($this->object->hasMultipleTrainings());
     $this->assertFalse($this->object->failed());
     $this->assertEquals('03.02.2015 10:01:11', date('d.m.Y H:i:s', $this->object->object()->getTimestamp()));
     $this->assertEquals(2766, $this->object->object()->getTimeInSeconds());
     $this->assertEquals(7.42, $this->object->object()->getDistance(), '', 0.1);
     $this->assertEquals(404, $this->object->object()->getCalories(), '', 10);
     $this->assertEquals(138, $this->object->object()->getPulseAvg(), '', 2);
     $this->assertEquals(162, $this->object->object()->getPulseMax(), '', 2);
     $this->assertEquals(0, count($this->object->object()->Splits()->distancesAsArray()));
 }