Annotation of embedaddon/php/ext/intl/tests/formatter_get_error.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: numfmt_get_error_message/code()
        !             3: --SKIPIF--
        !             4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
        !             5: --FILE--
        !             6: <?php
        !             7: 
        !             8: /*
        !             9:  * Error handling.
        !            10:  */
        !            11: 
        !            12: 
        !            13: function ut_main()
        !            14: {
        !            15:     $fmt = ut_nfmt_create( "en_US", NumberFormatter::CURRENCY );
        !            16:     $currency = '';
        !            17:     $pos = 0;
        !            18:     $num = ut_nfmt_parse_currency( $fmt, '123.45', $currency, $pos );
        !            19:     if( $num === false )
        !            20:         return $fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n";
        !            21:     else
        !            22:         return "Ooops, an error should have occured.";
        !            23: }
        !            24: 
        !            25: include_once( 'ut_common.inc' );
        !            26: 
        !            27: // Run the test
        !            28: ut_run();
        !            29: ?>
        !            30: --EXPECT--
        !            31: Number parsing failed: U_PARSE_ERROR (9)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>