r69689 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69688‎ | r69689 | r69690 >
Date:16:43, 21 July 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added unit tests
Modified paths:
  • /trunk/extensions/Maps/test/MapsDistanceParserTest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/test/MapsDistanceParserTest.php
@@ -34,12 +34,22 @@
3535 );
3636
3737 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+ ),
3844 'km' => array(
3945 '0.001 km' => 1,
4046 '1 km' => 1000,
4147 '4,24 km' => 4242,
4248 ),
43 -
 49+ 'kilometers' => array(
 50+ '0.001 kilometers' => 1,
 51+ '1 kilometers' => 1000,
 52+ '4,24 kilometers' => 4242,
 53+ ),
4454 );
4555
4656 /**
@@ -124,11 +134,13 @@
125135 * Tests MapsDistanceParser::isDistance()
126136 */
127137 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+ }
130141
131 - MapsDistanceParser::isDistance(/* parameters */);
132 -
 142+ foreach ( self::$distances as $distance ) {
 143+ $this->assertTrue( MapsDistanceParser::isDistance( $distance ), "'$distance' was not be recognized:" );
 144+ }
133145 }
134146
135147 /**

Status & tagging log