Annotation of embedaddon/php/ext/intl/tests/formatter_clone.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Cloning numfmt
! 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: $test_value = 12345.123456;
! 14: $fmt = new NumberFormatter( "en_US", NumberFormatter::PATTERN_DECIMAL );
! 15: $res_str .= "Formatted number: " . ut_nfmt_format( $fmt, $test_value ) . "\n";
! 16: $fmt_clone = clone $fmt;
! 17:
! 18: $res = $fmt->setPattern("0.0" );
! 19: if( $res === false )
! 20: $res_str .= ut_nfmt_get_error_message( $fmt ) . " (" . ut_nfmt_get_error_code( $fmt ) . ")\n";
! 21:
! 22: $res_str .= "Formatted number: " . ut_nfmt_format( $fmt, $test_value ) . "\n";
! 23: $res_str .= "Formatted(clone) number: " . ut_nfmt_format( $fmt_clone, $test_value ) . "\n";
! 24: echo $res_str;
! 25:
! 26: ?>
! 27: --EXPECTF--
! 28: Formatted number: 12345.123456
! 29: Formatted number: 12345.1
! 30: Formatted(clone) number: 12345.123456
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>