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