Annotation of embedaddon/php/ext/intl/tests/dateformat_get_timetype.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: datefmt_get_timetype_code()
! 3: --SKIPIF--
! 4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: /*
! 9: * Test for the datefmt_get_timetype function
! 10: */
! 11:
! 12:
! 13: function ut_main()
! 14: {
! 15: $timetype_arr = array (
! 16: IntlDateFormatter::FULL,
! 17: IntlDateFormatter::LONG,
! 18: IntlDateFormatter::MEDIUM,
! 19: IntlDateFormatter::SHORT,
! 20: IntlDateFormatter::NONE
! 21: );
! 22:
! 23: $res_str = '';
! 24:
! 25: foreach( $timetype_arr as $timetype_entry )
! 26: {
! 27: $res_str .= "\nCreating IntlDateFormatter with time_type = $timetype_entry";
! 28: $fmt = ut_datefmt_create( "de-DE", IntlDateFormatter::SHORT, $timetype_entry ,'America/Los_Angeles', IntlDateFormatter::GREGORIAN );
! 29: $time_type = ut_datefmt_get_timetype( $fmt);
! 30: $res_str .= "\nAfter call to get_timetype : timetype= $time_type";
! 31: $res_str .= "\n";
! 32: }
! 33:
! 34: return $res_str;
! 35:
! 36: }
! 37:
! 38: include_once( 'ut_common.inc' );
! 39:
! 40: // Run the test
! 41: ut_run();
! 42: ?>
! 43: --EXPECT--
! 44: Creating IntlDateFormatter with time_type = 0
! 45: After call to get_timetype : timetype= 0
! 46:
! 47: Creating IntlDateFormatter with time_type = 1
! 48: After call to get_timetype : timetype= 1
! 49:
! 50: Creating IntlDateFormatter with time_type = 2
! 51: After call to get_timetype : timetype= 2
! 52:
! 53: Creating IntlDateFormatter with time_type = 3
! 54: After call to get_timetype : timetype= 3
! 55:
! 56: Creating IntlDateFormatter with time_type = -1
! 57: After call to get_timetype : timetype= -1
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>