Index: trunk/extensions/Maps/test/MapsCoordinateParserTest.php |
— | — | @@ -184,44 +184,48 @@ |
185 | 185 | * Tests MapsCoordinateParser::areFloatCoordinates() |
186 | 186 | */ |
187 | 187 | public function testAreFloatCoordinates() { |
188 | | - // TODO Auto-generated MapsCoordinateParserTest::testAreFloatCoordinates() |
189 | | - $this->markTestIncomplete ( "areFloatCoordinates test not implemented" ); |
190 | | - |
191 | | - MapsCoordinateParser::areFloatCoordinates(/* parameters */); |
192 | | - |
| 188 | + foreach ( self::$fakeCoordinates as $coord ) { |
| 189 | + $this->assertFalse( MapsCoordinateParser::areFloatCoordinates( $coord ), "$coord was recognized as float." ); |
| 190 | + } |
| 191 | + foreach( self::$coordinates['float'] as $coord ) { |
| 192 | + $this->assertEquals( Maps_COORDS_FLOAT, MapsCoordinateParser::getCoordinatesType( $coord ), "$coord not recognized as float." ); |
| 193 | + } |
193 | 194 | } |
194 | 195 | |
195 | 196 | /** |
196 | 197 | * Tests MapsCoordinateParser::areDMSCoordinates() |
197 | 198 | */ |
198 | 199 | public function testAreDMSCoordinates() { |
199 | | - // TODO Auto-generated MapsCoordinateParserTest::testAreDMSCoordinates() |
200 | | - $this->markTestIncomplete ( "areDMSCoordinates test not implemented" ); |
201 | | - |
202 | | - MapsCoordinateParser::areDMSCoordinates(/* parameters */); |
203 | | - |
| 200 | + foreach ( self::$fakeCoordinates as $coord ) { |
| 201 | + $this->assertFalse( MapsCoordinateParser::areFloatCoordinates( $coord ), "$coord was recognized as dms." ); |
| 202 | + } |
| 203 | + foreach( self::$coordinates['dms'] as $coord ) { |
| 204 | + $this->assertEquals( Maps_COORDS_FLOAT, MapsCoordinateParser::getCoordinatesType( $coord ), "$coord not recognized as dms." ); |
| 205 | + } |
204 | 206 | } |
205 | 207 | |
206 | 208 | /** |
207 | 209 | * Tests MapsCoordinateParser::areDDCoordinates() |
208 | 210 | */ |
209 | 211 | public function testAreDDCoordinates() { |
210 | | - // TODO Auto-generated MapsCoordinateParserTest::testAreDDCoordinates() |
211 | | - $this->markTestIncomplete ( "areDDCoordinates test not implemented" ); |
212 | | - |
213 | | - MapsCoordinateParser::areDDCoordinates(/* parameters */); |
214 | | - |
| 212 | + foreach ( self::$fakeCoordinates as $coord ) { |
| 213 | + $this->assertFalse( MapsCoordinateParser::areFloatCoordinates( $coord ), "$coord was recognized as dd." ); |
| 214 | + } |
| 215 | + foreach( self::$coordinates['dd'] as $coord ) { |
| 216 | + $this->assertEquals( Maps_COORDS_FLOAT, MapsCoordinateParser::getCoordinatesType( $coord ), "$coord not recognized as dd." ); |
| 217 | + } |
215 | 218 | } |
216 | 219 | |
217 | 220 | /** |
218 | 221 | * Tests MapsCoordinateParser::areDMCoordinates() |
219 | 222 | */ |
220 | 223 | public function testAreDMCoordinates() { |
221 | | - // TODO Auto-generated MapsCoordinateParserTest::testAreDMCoordinates() |
222 | | - $this->markTestIncomplete ( "areDMCoordinates test not implemented" ); |
223 | | - |
224 | | - MapsCoordinateParser::areDMCoordinates(/* parameters */); |
225 | | - |
| 224 | + foreach ( self::$fakeCoordinates as $coord ) { |
| 225 | + $this->assertFalse( MapsCoordinateParser::areFloatCoordinates( $coord ), "$coord was recognized as dm." ); |
| 226 | + } |
| 227 | + foreach( self::$coordinates['dm'] as $coord ) { |
| 228 | + $this->assertEquals( Maps_COORDS_FLOAT, MapsCoordinateParser::getCoordinatesType( $coord ), "$coord not recognized as dm." ); |
| 229 | + } |
226 | 230 | } |
227 | 231 | |
228 | 232 | /** |
Index: trunk/extensions/Maps/RELEASE-NOTES |
— | — | @@ -22,6 +22,8 @@ |
23 | 23 | |
24 | 24 | * Improved the way marker data is turned into JavaScript variables. |
25 | 25 | |
| 26 | +* Improved coordinate recognition regexes. |
| 27 | + |
26 | 28 | === Maps 0.6.4 === |
27 | 29 | (2010-07-08) |
28 | 30 | |