Annotation of embedaddon/php/ext/intl/tests/formatter_get_locale.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: numfmt_get_locale()
                      3: --SKIPIF--
                      4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
                      5: --FILE--
                      6: <?php
                      7: 
                      8: /*
                      9:  * Get locale.
                     10:  */
                     11: 
                     12: function ut_main()
                     13: {
                     14:     $locales = array(
                     15:         'en_UK',
                     16:         'en_US@California',
                     17:         'fr_CA',
                     18:     );
                     19: 
                     20:     $loc_types = array(
                     21:         Locale::ACTUAL_LOCALE    => 'actual',
                     22:         Locale::VALID_LOCALE     => 'valid',
                     23:     );
                     24: 
                     25:     $res_str = '';
                     26: 
                     27:     foreach( $locales as $locale )
                     28:     {
                     29:         $fmt = ut_nfmt_create( $locale, NumberFormatter::DECIMAL );
                     30:         $res_str .= "$locale: ";
                     31:         foreach( $loc_types as $loc_type => $loc_type_name )
                     32:             $res_str .= sprintf( " %s=%s",
                     33:             $loc_type_name,
                     34:             dump( ut_nfmt_get_locale( $fmt, $loc_type ) ) );
                     35:         $res_str .= "\n";
                     36:     }
                     37: 
                     38:     return $res_str;
                     39: }
                     40: 
                     41: include_once( 'ut_common.inc' );
                     42: 
                     43: // Run the test
                     44: ut_run();
                     45: ?>
                     46: --EXPECT--
                     47: en_UK:  actual='en' valid='en'
                     48: en_US@California:  actual='en' valid='en'
                     49: fr_CA:  actual='fr_CA' valid='fr_CA'

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>