Index: trunk/extensions/Maps/test/MapsDistanceParserTest.php |
— | — | @@ -34,12 +34,22 @@ |
35 | 35 | ); |
36 | 36 | |
37 | 37 | public static $formatTests = array( |
| 38 | + 'm' => array( |
| 39 | + '1 m' => 1, |
| 40 | + '1000 m' => 1000.00, |
| 41 | + '42.42 m' => 42.42, |
| 42 | + '42.42 m' => 42.4242, |
| 43 | + ), |
38 | 44 | 'km' => array( |
39 | 45 | '0.001 km' => 1, |
40 | 46 | '1 km' => 1000, |
41 | 47 | '4,24 km' => 4242, |
42 | 48 | ), |
43 | | - |
| 49 | + 'kilometers' => array( |
| 50 | + '0.001 kilometers' => 1, |
| 51 | + '1 kilometers' => 1000, |
| 52 | + '4,24 kilometers' => 4242, |
| 53 | + ), |
44 | 54 | ); |
45 | 55 | |
46 | 56 | /** |
— | — | @@ -124,11 +134,13 @@ |
125 | 135 | * Tests MapsDistanceParser::isDistance() |
126 | 136 | */ |
127 | 137 | public function testIsDistance() { |
128 | | - // TODO Auto-generated MapsDistanceParserTest::testIsDistance() |
129 | | - $this->markTestIncomplete ( "isDistance test not implemented" ); |
| 138 | + foreach ( self::$fakeDistances as $fakeDistance ) { |
| 139 | + $this->assertFalse( MapsDistanceParser::isDistance( $fakeDistance ), "'$fakeDistance' should not be recognized:" ); |
| 140 | + } |
130 | 141 | |
131 | | - MapsDistanceParser::isDistance(/* parameters */); |
132 | | - |
| 142 | + foreach ( self::$distances as $distance ) { |
| 143 | + $this->assertTrue( MapsDistanceParser::isDistance( $distance ), "'$distance' was not be recognized:" ); |
| 144 | + } |
133 | 145 | } |
134 | 146 | |
135 | 147 | /** |