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

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

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