r69460 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69459‎ | r69460 | r69461 >
Date:02:15, 17 July 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added more unit tests
Modified paths:
  • /trunk/extensions/Maps/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/Maps/test/MapsCoordinateParserTest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/test/MapsCoordinateParserTest.php
@@ -184,44 +184,48 @@
185185 * Tests MapsCoordinateParser::areFloatCoordinates()
186186 */
187187 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+ }
193194 }
194195
195196 /**
196197 * Tests MapsCoordinateParser::areDMSCoordinates()
197198 */
198199 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+ }
204206 }
205207
206208 /**
207209 * Tests MapsCoordinateParser::areDDCoordinates()
208210 */
209211 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+ }
215218 }
216219
217220 /**
218221 * Tests MapsCoordinateParser::areDMCoordinates()
219222 */
220223 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+ }
226230 }
227231
228232 /**
Index: trunk/extensions/Maps/RELEASE-NOTES
@@ -22,6 +22,8 @@
2323
2424 * Improved the way marker data is turned into JavaScript variables.
2525
 26+* Improved coordinate recognition regexes.
 27+
2628 === Maps 0.6.4 ===
2729 (2010-07-08)
2830

Follow-up revisions

RevisionCommit summaryAuthorDate
r69461Follow up to r69460jeroendedauw02:24, 17 July 2010

Status & tagging log