Annotation of embedaddon/php/ext/intl/tests/dateformat_clone2.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Cloning datefmt icu >= 4.8
! 3: --SKIPIF--
! 4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
! 5: <?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
! 6: --FILE--
! 7: <?php
! 8: include_once( 'ut_common.inc' );
! 9: $GLOBALS['oo-mode'] = true;
! 10: $res_str = '';
! 11: /*
! 12: * Clone
! 13: */
! 14: $start_pattern = 'dd-MM-YY';
! 15: $fmt = ut_datefmt_create( "en-US", IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/New_York', IntlDateFormatter::GREGORIAN , $start_pattern );
! 16:
! 17: $formatted = ut_datefmt_format($fmt,0);
! 18: $res_str .= "\nResult of formatting timestamp=0 is : \n$formatted";
! 19:
! 20: $fmt_clone = clone $fmt;
! 21: ut_datefmt_set_pattern( $fmt , 'yyyy-DDD.hh:mm:ss z' );
! 22:
! 23: $formatted = ut_datefmt_format($fmt,0);
! 24: $res_str .= "\nResult of formatting timestamp=0 is : \n$formatted";
! 25: $formatted = ut_datefmt_format($fmt_clone,0);
! 26: $res_str .= "\nResult of clone formatting timestamp=0 is : \n$formatted";
! 27:
! 28: echo $res_str;
! 29:
! 30: ?>
! 31: --EXPECTF--
! 32: Result of formatting timestamp=0 is :
! 33: 31-12-70
! 34: Result of formatting timestamp=0 is :
! 35: 1969-365.07:00:00 EST
! 36: Result of clone formatting timestamp=0 is :
! 37: 31-12-70
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>