PHP  
 PHP_5_6
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/intl/tests/dateformat_set_timezone_id.phpt ('datefmt_set_timezone_id_code() icu <= 4.2')

Script

1: <?php
2:
3:
/*
4:  * Test for the datefmt_set_timezone_id  function
5:  */
6:
7:
8:
function ut_main()
9: {
10:     
$timezone_id_arr = array (
11:         
'America/New_York',
12:         
'America/Los_Angeles',
13:         
'America/Chicago',
14:         
'CN'
15:     
);
16:     
$timestamp_entry 0;
17:
18:     
$res_str '';
19:
20:     
$fmt ut_datefmt_create"en_US",  IntlDateFormatter::FULLIntlDateFormatter::FULL'America/San_Francisco' IntlDateFormatter::GREGORIAN  );
21:     
$timezone_id ut_datefmt_get_timezone_id$fmt );
22:     
$res_str .= "\nAfter creation of the dateformatter :  timezone_id= $timezone_id\n";
23:
24:     foreach( 
$timezone_id_arr as $timezone_id_entry )
25:     {
26:
27:         
$res_str .= "-----------";
28:         
$res_str .= "\nTrying to set timezone_id= $timezone_id_entry";
29:         
ut_datefmt_set_timezone_id$fmt $timezone_id_entry );
30:         
$timezone_id ut_datefmt_get_timezone_id$fmt );
31:         
$res_str .= "\nAfter call to set_timezone_id :  timezone_id= $timezone_id";
32:         
$formatted ut_datefmt_format$fmt0);
33:         
$res_str .= "\nFormatting timestamp=0 resulted in  $formatted";
34:         
$formatted ut_datefmt_format$fmt3600);
35:         
$res_str .= "\nFormatting timestamp=3600 resulted in  $formatted";
36:         
$res_str .= "\n";
37:
38:     }
39:
40:     return 
$res_str;
41:
42: }
43:
44: include_once( 
'ut_common.inc' );
45:
46:
// Run the test
47:
ut_run();
48:
?>
49:

Expected

After creation of the dateformatter :  timezone_id= America/San_Francisco
-----------
Trying to set timezone_id= America/New_York
After call to set_timezone_id :  timezone_id= America/New_York
Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 7:00:00 PM Eastern Standard Time
Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 8:00:00 PM Eastern Standard Time
-----------
Trying to set timezone_id= America/Los_Angeles
After call to set_timezone_id :  timezone_id= America/Los_Angeles
Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 4:00:00 PM Pacific Standard Time
Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 5:00:00 PM Pacific Standard Time
-----------
Trying to set timezone_id= America/Chicago
After call to set_timezone_id :  timezone_id= America/Chicago
Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 6:00:00 PM Central Standard Time
Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 7:00:00 PM Central Standard Time
-----------
Trying to set timezone_id= CN
After call to set_timezone_id :  timezone_id= CN
Formatting timestamp=0 resulted in  Thursday, January 1, 1970 12:00:00 AM GMT+00:00
Formatting timestamp=3600 resulted in  Thursday, January 1, 1970 1:00:00 AM GMT+00:00

Output

Fatal error: Call to a member function getTimeZoneId() on null in /var/php_gcov/PHP_5_6/ext/intl/tests/ut_common.inc on line 354

Diff

001+ Fatal error: Call to a member function getTimeZoneId() on null in /var/php_gcov/PHP_5_6/ext/intl/tests/ut_common.inc on line 354
001- After creation of the dateformatter :  timezone_id= America/San_Francisco
002- -----------
003- Trying to set timezone_id= America/New_York
004- After call to set_timezone_id :  timezone_id= America/New_York
005- Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 7:00:00 PM Eastern Standard Time
006- Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 8:00:00 PM Eastern Standard Time
007- -----------
008- Trying to set timezone_id= America/Los_Angeles
009- After call to set_timezone_id :  timezone_id= America/Los_Angeles
010- Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 4:00:00 PM Pacific Standard Time
011- Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 5:00:00 PM Pacific Standard Time
012- -----------
013- Trying to set timezone_id= America/Chicago
014- After call to set_timezone_id :  timezone_id= America/Chicago
015- Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 6:00:00 PM Central Standard Time
016- Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 7:00:00 PM Central Standard Time
017- -----------
018- Trying to set timezone_id= CN
019- After call to set_timezone_id :  timezone_id= CN
020- Formatting timestamp=0 resulted in  Thursday, January 1, 1970 12:00:00 AM GMT+00:00
021- Formatting timestamp=3600 resulted in  Thursday, January 1, 1970 1:00:00 AM GMT+00:00

 

Generated at Mon, 08 Sep 2014 17:35:45 +0000 (8 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.