public function testOsynceTimeProblem() { if (Shell::isPerlAvailable()) { $this->object->parseFile('../tests/testfiles/fit/osynce-stop-bug.fit'); $this->assertFalse($this->object->hasMultipleTrainings()); $this->assertFalse($this->object->failed()); $this->assertEquals('osynce', $this->object->object()->getCreator()); $this->assertEquals(47 * 60 + 6, $this->object->object()->getTimeInSeconds()); $this->assertEquals(47 * 60 + 6, $this->object->object()->getArrayTimeLastPoint()); $this->assertEquals(15.5, $this->object->object()->getDistance(), '', 0.1); $this->assertTrue($this->object->object()->hasArrayTime()); $this->assertTrue($this->object->object()->hasArrayDistance()); $this->assertTrue($this->object->object()->hasArrayAltitude()); $this->assertTrue($this->object->object()->hasArrayHeartrate()); $this->assertTrue($this->object->object()->hasArrayCadence()); $this->assertTrue($this->object->object()->hasArrayTemperature()); $this->assertTrue($this->object->object()->hasArrayPower()); $timeArray = $this->object->object()->getArrayTime(); $num = count($timeArray); for ($i = 2; $i < $num; ++$i) { if ($timeArray[$i] < $timeArray[$i - 1]) { $this->assertTrue(false, sprintf('Time array is not continuously increasing: %u < %u at index %u', $timeArray[$i], $timeArray[$i - 1], $i)); break; } } } }
public function testHRV() { if (Shell::isPerlAvailable()) { $this->object->parseFile('../tests/testfiles/fit/HRV-example.fit'); $this->assertFalse($this->object->hasMultipleTrainings()); $this->assertFalse($this->object->failed()); $this->assertTrue($this->object->object()->hasArrayHRV()); } }
public function testMultisportTriathlonFromFenix3() { if (Shell::isPerlAvailable()) { $this->object->parseFile('../tests/testfiles/fit/multisport-triathlon-fenix3.fit'); $this->assertFalse($this->object->failed()); $this->assertTrue($this->object->hasMultipleTrainings()); $this->assertEquals(5, $this->object->numberOfTrainings()); $Swimming = $this->object->object(0); $this->assertEquals('09.08.2015 09:13:03', date('d.m.Y H:i:s', $Swimming->getTimestamp())); $this->assertEquals(1.526, $Swimming->getDistance()); $this->assertEquals(2033, $Swimming->getTimeInSeconds()); $this->assertTrue($Swimming->hasArrayDistance()); $this->assertTrue($Swimming->hasArrayCadence()); $this->assertFalse($Swimming->hasArrayHeartrate()); $this->assertTrue($Swimming->hasArrayAltitude()); $this->assertFalse($Swimming->hasArrayVerticalOscillation()); $this->assertFalse($Swimming->hasArrayGroundContact()); $Transition1 = $this->object->object(1); $this->assertEquals('09.08.2015 09:48:47', date('d.m.Y H:i:s', $Transition1->getTimestamp())); $this->assertEquals(0.367, $Transition1->getDistance()); $this->assertEquals(165, $Transition1->getTimeInSeconds()); $Cycling = $this->object->object(2); $this->assertEquals('09.08.2015 09:51:35', date('d.m.Y H:i:s', $Cycling->getTimestamp())); $this->assertEquals(40.261, $Cycling->getDistance()); $this->assertEquals(4455, $Cycling->getTimeInSeconds()); $this->assertTrue($Cycling->hasArrayDistance()); $this->assertFalse($Cycling->hasArrayCadence()); $this->assertTrue($Cycling->hasArrayHeartrate()); $this->assertTrue($Cycling->hasArrayAltitude()); $this->assertFalse($Cycling->hasArrayVerticalOscillation()); $this->assertFalse($Cycling->hasArrayGroundContact()); $Transition2 = $this->object->object(3); $this->assertEquals('09.08.2015 11:05:48', date('d.m.Y H:i:s', $Transition2->getTimestamp())); $this->assertEquals(0.419, $Transition2->getDistance()); $this->assertEquals(109, $Transition2->getTimeInSeconds()); $Running = $this->object->object(4); $this->assertEquals('09.08.2015 11:07:41', date('d.m.Y H:i:s', $Running->getTimestamp())); $this->assertEquals(9.317, $Running->getDistance()); $this->assertEquals(2381, $Running->getTimeInSeconds()); $this->assertTrue($Running->hasArrayDistance()); $this->assertTrue($Running->hasArrayCadence()); $this->assertTrue($Running->hasArrayHeartrate()); $this->assertTrue($Running->hasArrayAltitude()); $this->assertTrue($Running->hasArrayVerticalOscillation()); $this->assertTrue($Running->hasArrayGroundContact()); } }