mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-18 22:23:45 +09:00
Added System of Measure (Metric) unit tests;
Reworked swimpace() function to show min:sec
This commit is contained in:
@@ -18,7 +18,7 @@ class WPStrava_SOMEnglishTest extends TestCase {
|
||||
* Test that 10,000 meters is 6.21 miles using both string and float inputs.
|
||||
*
|
||||
* @author Justin Foell <justin.foell@webdevstudios.com>
|
||||
* @since NEXT
|
||||
* @since 1.7.1
|
||||
*/
|
||||
public function test_distance() {
|
||||
$this->assertEquals( '6.21' , $this->som->distance( '10000' ) );
|
||||
@@ -29,7 +29,7 @@ class WPStrava_SOMEnglishTest extends TestCase {
|
||||
* Test that 6.213712 miles is 10,000.00 meters using both string and float inputs.
|
||||
*
|
||||
* @author Justin Foell <justin.foell@webdevstudios.com>
|
||||
* @since NEXT
|
||||
* @since 1.7.1
|
||||
*/
|
||||
public function test_distance_inverse() {
|
||||
$this->assertEquals( '10,000.00' , $this->som->distance_inverse( '6.213712' ) );
|
||||
@@ -40,7 +40,7 @@ class WPStrava_SOMEnglishTest extends TestCase {
|
||||
* Test that 6.705 meters per second is 15.00 mph using both string and float inputs.
|
||||
*
|
||||
* @author Justin Foell <justin.foell@webdevstudios.com>
|
||||
* @since NEXT
|
||||
* @since 1.7.1
|
||||
*/
|
||||
public function test_speed() {
|
||||
$this->assertEquals( '15.00', $this->som->speed( '6.705' ) );
|
||||
@@ -51,7 +51,7 @@ class WPStrava_SOMEnglishTest extends TestCase {
|
||||
* Test that 2.68224 meters per second is a 10:00 minute/mile pace using both string and float inputs.
|
||||
*
|
||||
* @author Justin Foell <justin.foell@webdevstudios.com>
|
||||
* @since NEXT
|
||||
* @since 1.7.1
|
||||
*/
|
||||
public function test_pace() {
|
||||
$this->assertEquals( '10:00', $this->som->pace( '2.68224' ) );
|
||||
@@ -62,10 +62,22 @@ class WPStrava_SOMEnglishTest extends TestCase {
|
||||
* Test that 60.96 meters is 200.00 feet using both string and float inputs.
|
||||
*
|
||||
* @author Justin Foell <justin.foell@webdevstudios.com>
|
||||
* @since NEXT
|
||||
* @since 1.7.1
|
||||
*/
|
||||
public function test_elevation() {
|
||||
$this->assertEquals( '200.00', $this->som->elevation( '60.96' ) );
|
||||
$this->assertEquals( '200.00', $this->som->elevation( 60.96 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that 4805 seconds is 01:20:05 time (H:i:s) using both string and float inputs.
|
||||
*
|
||||
* @author Justin Foell <justin.foell@webdevstudios.com>
|
||||
* @since 1.7.1
|
||||
*/
|
||||
public function test_time() {
|
||||
$this->assertEquals( '01:20:05', $this->som->time( '4805' ) );
|
||||
$this->assertEquals( '01:20:05', $this->som->time( 4805 ) );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user