Annotation of embedaddon/php/ext/intl/tests/dateformat_get_timezone_id.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: datefmt_get_timezone_id_code()
                      3: --SKIPIF--
                      4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
                      5: --FILE--
                      6: <?php
                      7: 
                      8: /*
                      9:  * Test for the datefmt_get_timezone_id  function
                     10:  */
                     11: 
                     12: 
                     13: function ut_main()
                     14: {
                     15:        $timezone_id_arr = array (
                     16:                'America/New_York',
                     17:                'America/Los_Angeles',
                     18:                'America/Dallas'
                     19:        );
                     20:        
                     21:        $res_str = '';
                     22: 
                     23:        foreach( $timezone_id_arr as $timezone_id_entry )
                     24:        {
                     25:                $res_str .= "\nCreating IntlDateFormatter with timezone_id = $timezone_id_entry";
                     26:                $fmt = ut_datefmt_create( "de-DE",  IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, $timezone_id_entry , IntlDateFormatter::GREGORIAN  );
                     27:                $timezone_id = ut_datefmt_get_timezone_id( $fmt);
                     28:                $res_str .= "\nAfter call to get_timezone_id :  timezone_id= $timezone_id";
                     29:                $res_str .= "\n";
                     30:        }
                     31: 
                     32:        return $res_str;
                     33: 
                     34: }
                     35: 
                     36: include_once( 'ut_common.inc' );
                     37: 
                     38: // Run the test
                     39: ut_run();
                     40: ?>
                     41: --EXPECT--
                     42: Creating IntlDateFormatter with timezone_id = America/New_York
                     43: After call to get_timezone_id :  timezone_id= America/New_York
                     44: 
                     45: Creating IntlDateFormatter with timezone_id = America/Los_Angeles
                     46: After call to get_timezone_id :  timezone_id= America/Los_Angeles
                     47: 
                     48: Creating IntlDateFormatter with timezone_id = America/Dallas
                     49: After call to get_timezone_id :  timezone_id= America/Dallas

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