Making WordPress.org


Ignore:
Timestamp:
03/07/2017 12:57:51 AM (7 years ago)
Author:
iandunn
Message:

Events API: Try to match country names if the city match failed

File:
1 edited

Legend:

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

    r5066 r5098  
    9999     $cases = array(
    100100        /*
    101          * Only the country is given
    102          */
    103         'country-australia' => array(
     101         * Only the country code is given
     102         */
     103        'country-code-australia' => array(
    104104            'input' => array(
    105105                'country' => 'AU',
     
    107107            'expected' => array(
    108108                'country' => 'AU'
     109            ),
     110        ),
     111
     112
     113        /*
     114         * The country name, locale, and timezone are given
     115         */
     116        'country-exonym-1-word' => array(
     117            'input' => array(
     118                'location_name' => 'Indonesia',
     119                'locale'        => 'id_ID',
     120                'timezone'      => 'Asia/Jakarta',
     121            ),
     122            'expected' => array(
     123                'country' => 'ID'
     124            ),
     125        ),
     126
     127        'country-exonym-2-words' => array(
     128            'input' => array(
     129                'location_name' => 'Bosnia and Herzegovina',
     130                'locale'        => 'bs_BA',
     131                'timezone'      => 'Europe/Sarajevo',
     132            ),
     133            'expected' => array(
     134                'country' => 'BA'
    109135            ),
    110136        ),
Note: See TracChangeset for help on using the changeset viewer.