r69465 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69464‎ | r69465 | r69466 >
Date:03:14, 17 July 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added tests
Modified paths:
  • /trunk/extensions/Maps/test/MapsCoordinateParserTest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/test/MapsCoordinateParserTest.php
@@ -52,19 +52,33 @@
5353 ),
5454 );
5555
 56+ // Expected result => array( everything that should lead to it )
5657 public static $coordinateMappings = array(
 58+ // Float to non-directional DMS
5759 'float-dms' => array(
5860 '42° 30\' 0", -42° 30\' 0"' => array( '42.5, -42.5', '42.5 N, 42.5 W' ),
5961 '-42° 30\' 0", 42° 30\' 0"' => array( '-42.5, 42.5', '42.5 S, 42.5 E' ),
6062 '42° 25\' 27", 42° 25\' 27"' => array( '42.4242, 42.4242', '42.4242 N, 42.4242 E' ),
6163 ),
 64+ // DMS to directional Float
 65+ 'dms-float-directional' => array(
 66+ '42.5 N, 42.5 W' => array( '42° 30\' 0", -42° 30\' 0"', '42° 30\' 0" N, 42° 30\' 0" W' ),
 67+ '42.5 S, 42.5 E' => array( '-42° 30\' 0", 42° 30\' 0"', '42° 30\' 0" S, 42° 30\' 0" E' ),
 68+ '42.4242 N, 42.4242 E' => array( '42° 25\' 27", 42° 25\' 27"', '42° 25\' 27" N, 42° 25\' 27" E' )
 69+ )
6270 );
6371
6472 public static $fakeCoordinates = array(
 73+ 'IN YOUR CODE, BEING TOTALLY REDICULOUSE',
6574 '55.7557860 E, 37.6176330 W',
6675 '55.7557860 N, 37.6176330 N',
6776 '55.7557860 S, 37.6176330 N',
6877 '55.7557860 N, 37.6176330 S',
 78+ '42.5, -42.5.5',
 79+ '42.5, --42.5',
 80+ '42.5-, 42.5',
 81+ '42.5, 42 -5',
 82+ '9342.5, -42.5'
6983 );
7084
7185 /**

Status & tagging log