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