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