Annotation of embedaddon/php/ext/intl/tests/locale_get_region.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: locale_get_region()
! 3: --SKIPIF--
! 4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: /*
! 9: * Try getting the region for different locales
! 10: * with Procedural and Object methods.
! 11: */
! 12:
! 13: function ut_main()
! 14: {
! 15: $res_str = '';
! 16:
! 17: $locales = array(
! 18: 'uk-ua_CALIFORNIA@currency=;currency=GRN',
! 19: 'root',
! 20: 'uk@currency=EURO',
! 21: 'Hindi',
! 22: //Simple language subtag
! 23: 'de',
! 24: 'fr',
! 25: 'ja',
! 26: 'i-enochian', //(example of a grandfathered tag)
! 27: //Language subtag plus Script subtag:
! 28: 'zh-Hant',
! 29: 'zh-Hans',
! 30: 'sr-Cyrl',
! 31: 'sr-Latn',
! 32: //Language-Script-Region
! 33: 'zh-Hans-CN',
! 34: 'sr-Latn-CS',
! 35: //Language-Variant
! 36: 'sl-rozaj',
! 37: 'sl-nedis',
! 38: //Language-Region-Variant
! 39: 'de-CH-1901',
! 40: 'sl-IT-nedis',
! 41: //Language-Script-Region-Variant
! 42: 'sl-Latn-IT-nedis',
! 43: //Language-Region:
! 44: 'de-DE',
! 45: 'en-US',
! 46: 'es-419',
! 47: //Private use subtags:
! 48: 'de-CH-x-phonebk',
! 49: 'az-Arab-x-AZE-derbend',
! 50: //Extended language subtags
! 51: 'zh-min',
! 52: 'zh-min-nan-Hant-CN',
! 53: //Private use registry values
! 54: 'x-whatever',
! 55: 'qaa-Qaaa-QM-x-southern',
! 56: 'sr-Latn-QM',
! 57: 'sr-Qaaa-CS',
! 58: /*Tags that use extensions (examples ONLY: extensions MUST be defined
! 59: by revision or update to this document or by RFC): */
! 60: 'en-US-u-islamCal',
! 61: 'zh-CN-a-myExt-x-private',
! 62: 'en-a-myExt-b-another',
! 63: //Some Invalid Tags:
! 64: 'de-419-DE',
! 65: 'a-DE',
! 66: 'ar-a-aaa-b-bbb-a-ccc'
! 67: );
! 68:
! 69:
! 70: $res_str = '';
! 71:
! 72: foreach( $locales as $locale )
! 73: {
! 74: $scr = ut_loc_get_region( $locale);
! 75: $res_str .= "$locale: region='$scr'";
! 76: $res_str .= "\n";
! 77: }
! 78:
! 79: return $res_str;
! 80:
! 81: }
! 82:
! 83: include_once( 'ut_common.inc' );
! 84: ut_run();
! 85:
! 86: ?>
! 87: --EXPECTF--
! 88: uk-ua_CALIFORNIA@currency=;currency=GRN: region='UA'
! 89: root: region=''
! 90: uk@currency=EURO: region=''
! 91: Hindi: region=''
! 92: de: region=''
! 93: fr: region=''
! 94: ja: region=''
! 95: i-enochian: region=''
! 96: zh-Hant: region=''
! 97: zh-Hans: region=''
! 98: sr-Cyrl: region=''
! 99: sr-Latn: region=''
! 100: zh-Hans-CN: region='CN'
! 101: sr-Latn-CS: region='CS'
! 102: sl-rozaj: region='%r(ROZAJ)?%r'
! 103: sl-nedis: region='%r(NEDIS)?%r'
! 104: de-CH-1901: region='CH'
! 105: sl-IT-nedis: region='IT'
! 106: sl-Latn-IT-nedis: region='IT'
! 107: de-DE: region='DE'
! 108: en-US: region='US'
! 109: es-419: region='419'
! 110: de-CH-x-phonebk: region='CH'
! 111: az-Arab-x-AZE-derbend: region='%r(X)?%r'
! 112: zh-min: region=''
! 113: zh-min-nan-Hant-CN: region='MIN'
! 114: x-whatever: region=''
! 115: qaa-Qaaa-QM-x-southern: region='QM'
! 116: sr-Latn-QM: region='QM'
! 117: sr-Qaaa-CS: region='CS'
! 118: en-US-u-islamCal: region='US'
! 119: zh-CN-a-myExt-x-private: region='CN'
! 120: en-a-myExt-b-another: region='%r(A)?%r'
! 121: de-419-DE: region='419'
! 122: a-DE: region='DE'
! 123: ar-a-aaa-b-bbb-a-ccc: region='%r(A)?%r'
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>