Index: trunk/extensions/Maps/test/MapsDistanceParserTest.php |
— | — | @@ -83,13 +83,6 @@ |
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
87 | | - * Constructs the test case. |
88 | | - */ |
89 | | - public function __construct() { |
90 | | - |
91 | | - } |
92 | | - |
93 | | - /** |
94 | 87 | * Tests MapsDistanceParser::parseDistance() |
95 | 88 | */ |
96 | 89 | public function testParseDistance() { |
— | — | @@ -115,11 +108,15 @@ |
116 | 109 | * Tests MapsDistanceParser::parseAndFormat() |
117 | 110 | */ |
118 | 111 | public function testParseAndFormat() { |
119 | | - // TODO Auto-generated MapsDistanceParserTest::testParseAndFormat() |
120 | | - $this->markTestIncomplete ( "parseAndFormat test not implemented" ); |
| 112 | + $conversions = array( |
| 113 | + '42 km' => '42000 m' |
| 114 | + ); |
121 | 115 | |
122 | | - MapsDistanceParser::parseAndFormat(/* parameters */); |
123 | | - |
| 116 | + foreach( array_merge( $conversions, array_reverse( $conversions ) ) as $source => $target ) { |
| 117 | + $unit = explode( ' ', $target, 2 ); |
| 118 | + $unit = $unit[1]; |
| 119 | + $this->assertEquals( $target, MapsDistanceParser::parseAndFormat( $source, $unit ), "'$source' was not parsed and formatted to '$target':" ); |
| 120 | + } |
124 | 121 | } |
125 | 122 | |
126 | 123 | /** |