Annotation of embedaddon/php/ext/intl/tests/collator_get_locale2.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: get_locale() icu >= 4.8
! 3: --SKIPIF--
! 4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
! 5: <?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
! 6: --FILE--
! 7: <?php
! 8:
! 9: /*
! 10: * Try to specify valid and invalid locale types when getting locale.
! 11: */
! 12:
! 13: function ut_main()
! 14: {
! 15: $locales = array(
! 16: Locale::VALID_LOCALE,
! 17: Locale::ACTUAL_LOCALE,
! 18: 100,
! 19: -100,
! 20: -9999999999999,
! 21: 9999999999999,
! 22: 1.2,
! 23: );
! 24:
! 25: $coll = ut_coll_create( 'en_US' );
! 26: $res_str = '';
! 27:
! 28: foreach( $locales as $locale )
! 29: {
! 30: $rc = ut_coll_get_locale( $coll, $locale );
! 31:
! 32: $res_str .= sprintf(
! 33: "Locale of type %s is %s\n",
! 34: dump( $locale ),
! 35: dump( $rc ) );
! 36: }
! 37:
! 38: return $res_str . "\n";
! 39: }
! 40:
! 41: include_once( 'ut_common.inc' );
! 42: ut_run();
! 43: ?>
! 44: --EXPECT--
! 45: Locale of type 1 is 'en_US'
! 46: Locale of type 0 is 'root'
! 47: Locale of type 100 is false
! 48: Locale of type -100 is false
! 49: Locale of type -9999999999999 is false
! 50: Locale of type 9999999999999 is false
! 51: Locale of type 1.2 is 'en_US'
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>