- Timestamp:
- 03/03/2017 09:20:07 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/events/1.0/tests/test-index.php
r5064 r5065 66 66 } 67 67 68 /* 69 * Normalize coordinates to account for minor differences in the databases 70 * 71 * Rounding to three decimal places means that we're still accurate within about 110 meters, which is 72 * good enough for our purposes. 73 * 74 * See https://gis.stackexchange.com/a/8674/49125 75 */ 76 if ( isset( $actual_result['latitude'], $actual_result['longitude'] ) ) { 77 $actual_result['latitude'] = number_format( round( $actual_result['latitude'], 3 ), 3 ); 78 $actual_result['longitude'] = number_format( round( $actual_result['longitude'], 3 ), 3 ); 79 } 80 68 81 $passed = $case['expected'] === $actual_result; 69 82 … … 121 134 'expected' => array( 122 135 'description' => 'nairobi', 123 'latitude' => '-1.283 3300',124 'longitude' => '36.81 66700',136 'latitude' => '-1.283', 137 'longitude' => '36.817', 125 138 'country' => 'KE', 126 139 ), … … 135 148 'expected' => array( 136 149 'description' => 'tokyo', 137 'latitude' => '35.6 895000',138 'longitude' => '139.69 17100',150 'latitude' => '35.690', 151 'longitude' => '139.692', 139 152 'country' => 'JP', 140 153 ), … … 149 162 'expected' => array( 150 163 'description' => 'berlin', 151 'latitude' => '52.524 3700',152 'longitude' => '13.41 05300',164 'latitude' => '52.524', 165 'longitude' => '13.411', 153 166 'country' => 'DE', 154 167 ), … … 163 176 'expected' => array( 164 177 'description' => 'vancouver', 165 'latitude' => '49.2 496600',166 'longitude' => '-123.119 3400',178 'latitude' => '49.250', 179 'longitude' => '-123.119', 167 180 'country' => 'CA', 168 181 ), … … 177 190 'expected' => array( 178 191 'description' => 'brisbane', 179 'latitude' => '-27.46 79400',180 'longitude' => '153.028 0900',192 'latitude' => '-27.468', 193 'longitude' => '153.028', 181 194 'country' => 'AU', 182 195 ), … … 191 204 'expected' => array( 192 205 'description' => 'são paulo', 193 'latitude' => '-23.54 75000',194 'longitude' => '-46.636 1100',206 'latitude' => '-23.548', 207 'longitude' => '-46.636', 195 208 'country' => 'BR', 196 209 ), … … 205 218 'expected' => array( 206 219 'description' => 'harare', 207 'latitude' => '-17.829 35',208 'longitude' => '31.05 389',220 'latitude' => '-17.829', 221 'longitude' => '31.054', 209 222 'country' => 'ZW', 210 223 ), … … 215 228 'expected' => array( 216 229 'description' => 'amman', 217 'latitude' => '31.955 22',218 'longitude' => '35.945 03',230 'latitude' => '31.955', 231 'longitude' => '35.945', 219 232 'country' => 'JO', 220 233 ), … … 225 238 'expected' => array( 226 239 'description' => 'belfast', 227 'latitude' => '54.583 33',228 'longitude' => '-5.933 33',240 'latitude' => '54.583', 241 'longitude' => '-5.933', 229 242 'country' => 'GB', 230 243 ), … … 235 248 'expected' => array( 236 249 'description' => 'mexico city', 237 'latitude' => '19.428 47',238 'longitude' => '-99.12 766',250 'latitude' => '19.428', 251 'longitude' => '-99.128', 239 252 'country' => 'MX', 240 253 ), … … 245 258 'expected' => array( 246 259 'description' => 'auckland', 247 'latitude' => '-36.86 667',248 'longitude' => '174.76 667',260 'latitude' => '-36.867', 261 'longitude' => '174.767', 249 262 'country' => 'NZ', 250 263 ), … … 255 268 'expected' => array( 256 269 'description' => 'lima', 257 'latitude' => '-12.043 333',258 'longitude' => '-77.028 333',270 'latitude' => '-12.043', 271 'longitude' => '-77.028', 259 272 'country' => 'PE', 260 273 ),
Note: See TracChangeset
for help on using the changeset viewer.