Making WordPress.org

Changeset 5418


Ignore:
Timestamp:
04/27/2017 06:11:21 PM (9 years ago)
Author:
iandunn
Message:

Events: Add some test cases for cities with non-alpha characters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/events/1.0/tests/test-index.php

    r5417 r5418  
    285285                ),
    286286
     287                'city-with-apostrophe-in-formal-name' => array(
     288                        'input' => array(
     289                                'location_name' => "Coeur d'Alene",
     290                                'locale'        => 'en_US',
     291                                'timezone'      => 'America/Los_Angeles',
     292                        ),
     293                        'expected' => array(
     294                                'description' => "coeur d'alene",
     295                                'latitude'    => '47.678',
     296                                'longitude'   => '-116.780',
     297                                'country'     => 'US',
     298                        ),
     299                ),
     300
     301                /*
     302                 * todo This is failing. Not sure why at first glance, it looks like it matches the row in the database exactly.
     303                 *      It might be a similar issue to `Yaoundé`. If it is, this should still be kept as a separate test after
     304                 *      that is fixed, to make sure there aren't regressions with diacritics.
     305                 */
     306                'city-with-diacritics-in-query' => array(
     307                        'input' => array(
     308                                'location_name' => "Doña Ana",
     309                                'locale'        => 'en_US',
     310                                'timezone'      => 'America/Denver',
     311                        ),
     312                        'expected' => array(
     313                                'description' => "doña ana",
     314                                'latitude'    => '32.390',
     315                                'longitude'   => '-106.814',
     316                                'country'     => 'US',
     317                        ),
     318                ),
     319
     320                'city-with-diacritics-in-formal-name-but-not-in-query' => array(
     321                        'input' => array(
     322                                'location_name' => "Dona Ana",
     323                                'locale'        => 'en_US',
     324                                'timezone'      => 'America/Denver',
     325                        ),
     326                        'expected' => array(
     327                                'description' => "doña ana",
     328                                'latitude'    => '32.390',
     329                                'longitude'   => '-106.814',
     330                                'country'     => 'US',
     331                        ),
     332                ),
     333
     334                'city-with-period-in-query' => array(
     335                        'input' => array(
     336                                'location_name' => "St. Louis",
     337                                'locale'        => 'en_US',
     338                                'timezone'      => 'America/Chicago',
     339                        ),
     340                        'expected' => array(
     341                                'description' => "st. louis",
     342                                'latitude'    => '38.627',
     343                                'longitude'   => '-90.198',
     344                                'country'     => 'US',
     345                        ),
     346                ),
     347
     348                'city-with-period-in-formal-name-but-not-in-query' => array(
     349                        'input' => array(
     350                                'location_name' => "St Louis",
     351                                'locale'        => 'en_US',
     352                                'timezone'      => 'America/Chicago',
     353                        ),
     354                        'expected' => array(
     355                                'description' => "st. louis",
     356                                'latitude'    => '38.627',
     357                                'longitude'   => '-90.198',
     358                                'country'     => 'US',
     359                        ),
     360                ),
     361
    287362                /*
    288363                 * The city endonym, locale, and timezone are given
Note: See TracChangeset for help on using the changeset viewer.