diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/intl/tests/dateformat_clone.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/intl/tests/dateformat_clone.phpt')
-rw-r--r-- | ext/intl/tests/dateformat_clone.phpt | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/ext/intl/tests/dateformat_clone.phpt b/ext/intl/tests/dateformat_clone.phpt new file mode 100644 index 0000000..f060444 --- /dev/null +++ b/ext/intl/tests/dateformat_clone.phpt @@ -0,0 +1,37 @@ +--TEST-- +Cloning datefmt icu <= 4.2 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +<?php if(version_compare(INTL_ICU_VERSION, '4.3', '<') != 1) print 'skip'; ?> +--FILE-- +<?php +include_once( 'ut_common.inc' ); +$GLOBALS['oo-mode'] = true; +$res_str = ''; +/* + * Clone + */ +$start_pattern = 'dd-MM-YY'; +$fmt = ut_datefmt_create( "en-US", IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/New_York', IntlDateFormatter::GREGORIAN , $start_pattern ); + +$formatted = ut_datefmt_format($fmt,0); +$res_str .= "\nResult of formatting timestamp=0 is : \n$formatted"; + +$fmt_clone = clone $fmt; +ut_datefmt_set_pattern( $fmt , 'yyyy-DDD.hh:mm:ss z' ); + +$formatted = ut_datefmt_format($fmt,0); +$res_str .= "\nResult of formatting timestamp=0 is : \n$formatted"; +$formatted = ut_datefmt_format($fmt_clone,0); +$res_str .= "\nResult of clone formatting timestamp=0 is : \n$formatted"; + +echo $res_str; + +?> +--EXPECTF-- +Result of formatting timestamp=0 is : +31-12-69 +Result of formatting timestamp=0 is : +1969-365.07:00:00 EST +Result of clone formatting timestamp=0 is : +31-12-69 |