Index: trunk/extensions/Maps/test/MapsCoordinateParserTest.php |
— | — | @@ -52,19 +52,33 @@ |
53 | 53 | ), |
54 | 54 | ); |
55 | 55 | |
| 56 | + // Expected result => array( everything that should lead to it ) |
56 | 57 | public static $coordinateMappings = array( |
| 58 | + // Float to non-directional DMS |
57 | 59 | 'float-dms' => array( |
58 | 60 | '42° 30\' 0", -42° 30\' 0"' => array( '42.5, -42.5', '42.5 N, 42.5 W' ), |
59 | 61 | '-42° 30\' 0", 42° 30\' 0"' => array( '-42.5, 42.5', '42.5 S, 42.5 E' ), |
60 | 62 | '42° 25\' 27", 42° 25\' 27"' => array( '42.4242, 42.4242', '42.4242 N, 42.4242 E' ), |
61 | 63 | ), |
| 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 | + ) |
62 | 70 | ); |
63 | 71 | |
64 | 72 | public static $fakeCoordinates = array( |
| 73 | + 'IN YOUR CODE, BEING TOTALLY REDICULOUSE', |
65 | 74 | '55.7557860 E, 37.6176330 W', |
66 | 75 | '55.7557860 N, 37.6176330 N', |
67 | 76 | '55.7557860 S, 37.6176330 N', |
68 | 77 | '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' |
69 | 83 | ); |
70 | 84 | |
71 | 85 | /** |