Annotation of embedaddon/php/ext/intl/tests/dateformat_get_datetype.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: datefmt_get_datetype_code()
! 3: --SKIPIF--
! 4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: /*
! 9: * Test for the datefmt_get_datetype function
! 10: */
! 11:
! 12:
! 13: function ut_main()
! 14: {
! 15: $datetype_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( $datetype_arr as $datetype_entry )
! 26: {
! 27: $res_str .= "\nCreating IntlDateFormatter with date_type = $datetype_entry";
! 28: $fmt = ut_datefmt_create( "de-DE", $datetype_entry , IntlDateFormatter::SHORT,'America/Los_Angeles', IntlDateFormatter::GREGORIAN );
! 29: $date_type = ut_datefmt_get_datetype( $fmt);
! 30: $res_str .= "\nAfter call to get_datetype : datetype= $date_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 date_type = 0
! 45: After call to get_datetype : datetype= 0
! 46:
! 47: Creating IntlDateFormatter with date_type = 1
! 48: After call to get_datetype : datetype= 1
! 49:
! 50: Creating IntlDateFormatter with date_type = 2
! 51: After call to get_datetype : datetype= 2
! 52:
! 53: Creating IntlDateFormatter with date_type = 3
! 54: After call to get_datetype : datetype= 3
! 55:
! 56: Creating IntlDateFormatter with date_type = -1
! 57: After call to get_datetype : datetype= -1
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>