File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / intl / tests / dateformat_get_timezone_id.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:56 2012 UTC (12 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
datefmt_get_timezone_id_code()
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php

/*
 * Test for the datefmt_get_timezone_id  function
 */


function ut_main()
{
	$timezone_id_arr = array (
		'America/New_York',
		'America/Los_Angeles',
		'America/Dallas'
	);
	
	$res_str = '';

	foreach( $timezone_id_arr as $timezone_id_entry )
	{
		$res_str .= "\nCreating IntlDateFormatter with timezone_id = $timezone_id_entry";
		$fmt = ut_datefmt_create( "de-DE",  IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, $timezone_id_entry , IntlDateFormatter::GREGORIAN  );
		$timezone_id = ut_datefmt_get_timezone_id( $fmt);
		$res_str .= "\nAfter call to get_timezone_id :  timezone_id= $timezone_id";
		$res_str .= "\n";
	}

	return $res_str;

}

include_once( 'ut_common.inc' );

// Run the test
ut_run();
?>
--EXPECT--
Creating IntlDateFormatter with timezone_id = America/New_York
After call to get_timezone_id :  timezone_id= America/New_York

Creating IntlDateFormatter with timezone_id = America/Los_Angeles
After call to get_timezone_id :  timezone_id= America/Los_Angeles

Creating IntlDateFormatter with timezone_id = America/Dallas
After call to get_timezone_id :  timezone_id= America/Dallas

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