cvs: pecl(PHP_5_2) /intl/tests dateformat_format.phpt dateformat_localtime.phpt dateformat_parse.phpt dateformat_parse_localtime_parsepos.phpt
dateformat_parse_timestamp_parsepos.phpt

From: Date: Thu, 03 Apr 2008 20:54:07 +0000
Subject: cvs: pecl(PHP_5_2) /intl/tests dateformat_format.phpt dateformat_localtime.phpt dateformat_parse.phpt dateformat_parse_localtime_parsepos.phpt
dateformat_parse_timestamp_parsepos.phpt
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-10296@lists.php.net to get a copy of this message
kirtig Thu Apr 3 20:54:07 2008 UTC Modified files: (Branch: PHP_5_2) /pecl/intl/tests dateformat_format.phpt dateformat_localtime.phpt dateformat_parse.phpt dateformat_parse_localtime_parsepos.phpt dateformat_parse_timestamp_parsepos.phpt Log: Improved test cases

http://cvs.php.net/viewvc.cgi/pecl/intl/tests/dateformat_format.phpt?r1=1.1.2.7&r2=1.1.2.8&diff_format=u Index: pecl/intl/tests/dateformat_format.phpt diff -u pecl/intl/tests/dateformat_format.phpt:1.1.2.7 pecl/intl/tests/dateformat_format.phpt:1.1.2.8 --- pecl/intl/tests/dateformat_format.phpt:1.1.2.7 Wed Apr 2 13:28:50 2008 +++ pecl/intl/tests/dateformat_format.phpt Thu Apr 3 20:54:07 2008 @@ -46,7 +46,7 @@ 'tm_mon' => 3, 'tm_year' => 105, 'tm_wday' => 0, - 'tm_yday' => 92, + 'tm_yday' => 93, 'tm_isdst' => 1 ); $localtime_arr2 = array ( @@ -56,8 +56,8 @@ 'tm_mday' => 3, 'tm_mon' => 3, 'tm_year' => 205, - 'tm_wday' => 0, - 'tm_yday' => 92, + 'tm_wday' => 5, + 'tm_yday' => 93, 'tm_isdst' => 1 ); $localtime_arr3 = array ( @@ -66,9 +66,9 @@ 'tm_hour' => 3, 'tm_mday' => 3, 'tm_mon' => 3, - 'tm_year' => -205, - 'tm_wday' => 0, - 'tm_yday' => 92, + 'tm_year' => -5, + 'tm_wday' => 3, + 'tm_yday' => 93, 'tm_isdst' => 1 ); @@ -252,7 +252,7 @@ Formatted timestamp is : 19691231 03:00 PM ------------ -Input localtime is : tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_mday : '3' , tm_mon : '3' , tm_year : '105' , tm_wday : '0' , tm_yday : '92' , tm_isdst : '1' , +Input localtime is : tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_mday : '3' , tm_mon : '3' , tm_year : '105' , tm_wday : '0' , tm_yday : '93' , tm_isdst : '1' , ------------ DateFormatter locale= en_US ,datetype = 0 ,timetype =0 @@ -267,7 +267,7 @@ Formatted localtime_array is : 20050403 07:03 PM ------------ -Input localtime is : tm_sec : '24' , tm_min : '3' , tm_hour : '3' , tm_mday : '3' , tm_mon : '3' , tm_year : '205' , tm_wday : '0' , tm_yday : '92' , tm_isdst : '1' , +Input localtime is : tm_sec : '24' , tm_min : '3' , tm_hour : '3' , tm_mday : '3' , tm_mon : '3' , tm_year : '205' , tm_wday : '5' , tm_yday : '93' , tm_isdst : '1' , ------------ DateFormatter locale= en_US ,datetype = 0 ,timetype =0 @@ -282,16 +282,16 @@ Formatted localtime_array is : 21050403 03:03 AM ------------ -Input localtime is : tm_sec : '24' , tm_min : '3' , tm_hour : '3' , tm_mday : '3' , tm_mon : '3' , tm_year : '-205' , tm_wday : '0' , tm_yday : '92' , tm_isdst : '1' , +Input localtime is : tm_sec : '24' , tm_min : '3' , tm_hour : '3' , tm_mday : '3' , tm_mon : '3' , tm_year : '-5' , tm_wday : '3' , tm_yday : '93' , tm_isdst : '1' , ------------ DateFormatter locale= en_US ,datetype = 0 ,timetype =0 -Formatted localtime_array is : Sunday, April 3, 1695 3:03:24 AM PT +Formatted localtime_array is : Wednesday, April 3, 1895 3:03:24 AM PT DateFormatter locale= en_US ,datetype = 1 ,timetype =1 -Formatted localtime_array is : April 3, 1695 3:03:24 AM PDT +Formatted localtime_array is : April 3, 1895 3:03:24 AM PDT DateFormatter locale= en_US ,datetype = 2 ,timetype =2 -Formatted localtime_array is : Apr 3, 1695 3:03:24 AM +Formatted localtime_array is : Apr 3, 1895 3:03:24 AM DateFormatter locale= en_US ,datetype = 3 ,timetype =3 Formatted localtime_array is : 4/3/95 3:03 AM DateFormatter locale= en_US ,datetype = -1 ,timetype =-1 -Formatted localtime_array is : 16950403 03:03 AM +Formatted localtime_array is : 18950403 03:03 AM http://cvs.php.net/viewvc.cgi/pecl/intl/tests/dateformat_localtime.phpt?r1=1.1.2.4&r2=1.1.2.5&diff_format=u Index: pecl/intl/tests/dateformat_localtime.phpt diff -u pecl/intl/tests/dateformat_localtime.phpt:1.1.2.4 pecl/intl/tests/dateformat_localtime.phpt:1.1.2.5 --- pecl/intl/tests/dateformat_localtime.phpt:1.1.2.4 Fri Mar 21 23:59:28 2008 +++ pecl/intl/tests/dateformat_localtime.phpt Thu Apr 3 20:54:07 2008 @@ -26,30 +26,33 @@ $res_str = ''; - - $text_arr = array ( - "Thursday, December 18, 1969 8:49:59 AM PST", - "Thursday, December 18, 1969 8:49:59 PM PST", - "June 18, 1969 8:49:59 AM PST", - "12/18/69 8:49:59 AM", - "19691218 08:49:59 AM" - ); - - $fmt1 = ut_datefmt_create( 'en_US_CA', DateFormatter::SHORT, DateFormatter::SHORT); - $fmt2 = ut_datefmt_create( 'en_US_CA', DateFormatter::NONE, DateFormatter::NONE); - $fmt3 = ut_datefmt_create( 'en_US_CA', DateFormatter::LONG, DateFormatter::LONG); - $fmt4 = ut_datefmt_create( 'en_US_CA', DateFormatter::MEDIUM, DateFormatter::MEDIUM); - $fmt5 = ut_datefmt_create( 'en_US_CA', DateFormatter::FULL, DateFormatter::FULL); - $fmt_array = array( - $fmt1 , $fmt2 ,$fmt3 , $fmt4 ,$fmt5 - ); - $fmt_desc_array = array( - "DateType::SHORT, TimeType::SHORT", - "DateType::NONE, TimeType::NONE", - "DateType::LONG, TimeType::LONG", - "DateType::MEDIUM, TimeType::MEDIUM", - "DateType::FULL, TimeType::FULL" - ); + $datetype_arr = array ( + DateFormatter::FULL, + DateFormatter::LONG, + DateFormatter::MEDIUM, + ); + + $res_str = ''; + + + $text_arr = array ( + "Thursday, December 18, 1969 8:49:59 AM PST", + "June 18, 1969 8:49:59 AM ", + "12/18/69 8:49 AM", + "19691218 08:49 AM" + ); + + $fmt1 = ut_datefmt_create( 'en_US_CA', DateFormatter::LONG, DateFormatter::LONG); + $fmt2 = ut_datefmt_create( 'en_US_CA', DateFormatter::MEDIUM, DateFormatter::MEDIUM); + $fmt3 = ut_datefmt_create( 'en_US_CA', DateFormatter::FULL, DateFormatter::FULL); + $fmt_array = array( + $fmt1 , $fmt2 ,$fmt3 + ); + $fmt_desc_array = array( + "DateType::LONG, TimeType::LONG", + "DateType::MEDIUM, TimeType::MEDIUM", + "DateType::FULL, TimeType::FULL" + ); foreach( $text_arr as $text_entry){ $res_str .= "\n-------------------------------\n"; @@ -57,7 +60,6 @@ $cnt =0; $parse_pos = 0; - //for ( $parse_pos = 0 ; $parse_pos < strlen($text_entry) ; $parse_pos++ ){ foreach( $fmt_array as $fmt_entry ){ $res_str .= "\n------------"; @@ -78,7 +80,6 @@ } */ }//end of for $fmt_array - //} //end of for $parse_pos } @@ -96,52 +97,25 @@ Input text is : Thursday, December 18, 1969 8:49:59 AM PST ------------ -DateFormatter : DateType::SHORT, TimeType::SHORT ------------- -DateFormatter : DateType::NONE, TimeType::NONE ------------- -DateFormatter : DateType::LONG, TimeType::LONG ------------- -DateFormatter : DateType::MEDIUM, TimeType::MEDIUM ------------- -DateFormatter : DateType::FULL, TimeType::FULL -tm_sec : '59' , tm_min : '49' , tm_hour : '8' , tm_year : '69' , tm_mday : '18' , tm_wday : '5' , tm_yday : '352' , tm_mon : '11' , tm_isdst : '0' , -------------------------------- - -Input text is : Thursday, December 18, 1969 8:49:59 PM PST ------------- -DateFormatter : DateType::SHORT, TimeType::SHORT ------------- -DateFormatter : DateType::NONE, TimeType::NONE ------------- DateFormatter : DateType::LONG, TimeType::LONG ------------ DateFormatter : DateType::MEDIUM, TimeType::MEDIUM ------------ DateFormatter : DateType::FULL, TimeType::FULL -tm_sec : '59' , tm_min : '49' , tm_hour : '20' , tm_year : '69' , tm_mday : '18' , tm_wday : '5' , tm_yday : '352' , tm_mon : '11' , tm_isdst : '0' , +tm_sec : '59' , tm_min : '49' , tm_hour : '8' , tm_year : '69' , tm_mday : '18' , tm_wday : '4' , tm_yday : '352' , tm_mon : '11' , tm_isdst : '0' , ------------------------------- -Input text is : June 18, 1969 8:49:59 AM PST ------------- -DateFormatter : DateType::SHORT, TimeType::SHORT ------------- -DateFormatter : DateType::NONE, TimeType::NONE +Input text is : June 18, 1969 8:49:59 AM ------------ DateFormatter : DateType::LONG, TimeType::LONG -tm_sec : '59' , tm_min : '49' , tm_hour : '9' , tm_year : '69' , tm_mday : '18' , tm_wday : '4' , tm_yday : '169' , tm_mon : '5' , tm_isdst : '1' , ------------ DateFormatter : DateType::MEDIUM, TimeType::MEDIUM -tm_sec : '59' , tm_min : '49' , tm_hour : '8' , tm_year : '69' , tm_mday : '18' , tm_wday : '4' , tm_yday : '169' , tm_mon : '5' , tm_isdst : '1' , +tm_sec : '59' , tm_min : '49' , tm_hour : '8' , tm_year : '69' , tm_mday : '18' , tm_wday : '3' , tm_yday : '169' , tm_mon : '5' , tm_isdst : '1' , ------------ DateFormatter : DateType::FULL, TimeType::FULL ------------------------------- -Input text is : 12/18/69 8:49:59 AM ------------- -DateFormatter : DateType::SHORT, TimeType::SHORT ------------- -DateFormatter : DateType::NONE, TimeType::NONE +Input text is : 12/18/69 8:49 AM ------------ DateFormatter : DateType::LONG, TimeType::LONG ------------ @@ -150,14 +124,10 @@ DateFormatter : DateType::FULL, TimeType::FULL ------------------------------- -Input text is : 19691218 08:49:59 AM ------------- -DateFormatter : DateType::SHORT, TimeType::SHORT ------------- -DateFormatter : DateType::NONE, TimeType::NONE +Input text is : 19691218 08:49 AM ------------ DateFormatter : DateType::LONG, TimeType::LONG ------------ DateFormatter : DateType::MEDIUM, TimeType::MEDIUM ------------ -DateFormatter : DateType::FULL, TimeType::FULL +DateFormatter : DateType::FULL, TimeType::FULL \ No newline at end of file http://cvs.php.net/viewvc.cgi/pecl/intl/tests/dateformat_parse.phpt?r1=1.1.2.5&r2=1.1.2.6&diff_format=u Index: pecl/intl/tests/dateformat_parse.phpt diff -u pecl/intl/tests/dateformat_parse.phpt:1.1.2.5 pecl/intl/tests/dateformat_parse.phpt:1.1.2.6 --- pecl/intl/tests/dateformat_parse.phpt:1.1.2.5 Fri Mar 21 23:59:28 2008 +++ pecl/intl/tests/dateformat_parse.phpt Thu Apr 3 20:54:07 2008 @@ -29,6 +29,7 @@ $text_arr = array ( "Sunday, September 18, 2039 4:06:40 PM PT", + "Wednesday, December 17, 1969 6:40:00 PM PT", "Thursday, December 18, 1969 8:49:59 AM PST", "Thursday, December 18, 1969 8:49:59 PM PST", "December 18, 1969 8:49:59 AM PST", @@ -66,6 +67,8 @@ --EXPECT-- Input text :Sunday, September 18, 2039 4:06:40 PM PT ; Parsed text : 96000 ; parse_pos : 29 Input text :Sunday, September 18, 2039 4:06:40 PM PT ; Parsed text : 96000 ; parse_pos : 30 +Input text :Wednesday, December 17, 1969 6:40:00 PM PT ; Parsed text : 216000 ; parse_pos : 31 +Input text :Wednesday, December 17, 1969 6:40:00 PM PT ; Parsed text : 72000 ; parse_pos : 32 Input text :Thursday, December 18, 1969 8:49:59 AM PST ; Parsed text : 208740 ; parse_pos : 30 Input text :Thursday, December 18, 1969 8:49:59 AM PST ; Parsed text : 64740 ; parse_pos : 31 Input text :Thursday, December 18, 1969 8:49:59 PM PST ; Parsed text : 251940 ; parse_pos : 30 @@ -76,4 +79,4 @@ Input text :12/18/69 8:49 AM ; Parsed text : 60540 ; parse_pos : 9 Input text :19691218 08:49 AM ; Parsed text : 60540 ; parse_pos : 8 Input text :19691218 08:49 AM ; Parsed text : 60540 ; parse_pos : 9 -Input text :19691218 08:49 AM ; Parsed text : 60540 ; parse_pos : 10 \ No newline at end of file +Input text :19691218 08:49 AM ; Parsed text : 60540 ; parse_pos : 10 http://cvs.php.net/viewvc.cgi/pecl/intl/tests/dateformat_parse_localtime_parsepos.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: pecl/intl/tests/dateformat_parse_localtime_parsepos.phpt diff -u pecl/intl/tests/dateformat_parse_localtime_parsepos.phpt:1.1.2.2 pecl/intl/tests/dateformat_parse_localtime_parsepos.phpt:1.1.2.3 --- pecl/intl/tests/dateformat_parse_localtime_parsepos.phpt:1.1.2.2 Fri Mar 21 23:59:28 2008 +++ pecl/intl/tests/dateformat_parse_localtime_parsepos.phpt Thu Apr 3 20:54:07 2008 @@ -20,8 +20,6 @@ DateFormatter::FULL, DateFormatter::LONG, DateFormatter::MEDIUM, - DateFormatter::SHORT, - DateFormatter::NONE ); $res_str = ''; @@ -29,22 +27,18 @@ $text_arr = array ( "Thursday, December 18, 1969 8:49:59 AM PST", - "June 18, 1969 8:49:59 AM PST", - "12/18/69 8:49:59 AM", - "19691218 08:49:59 AM" + "June 18, 1969 8:49:59 AM ", + "12/18/69 8:49 AM", + "19691218 08:49 AM" ); - $fmt1 = ut_datefmt_create( 'en_US_CA', DateFormatter::SHORT, DateFormatter::SHORT); - $fmt2 = ut_datefmt_create( 'en_US_CA', DateFormatter::NONE, DateFormatter::NONE); - $fmt3 = ut_datefmt_create( 'en_US_CA', DateFormatter::LONG, DateFormatter::LONG); - $fmt4 = ut_datefmt_create( 'en_US_CA', DateFormatter::MEDIUM, DateFormatter::MEDIUM); - $fmt5 = ut_datefmt_create( 'en_US_CA', DateFormatter::FULL, DateFormatter::FULL); + $fmt1 = ut_datefmt_create( 'en_US_CA', DateFormatter::LONG, DateFormatter::LONG); + $fmt2 = ut_datefmt_create( 'en_US_CA', DateFormatter::MEDIUM, DateFormatter::MEDIUM); + $fmt3 = ut_datefmt_create( 'en_US_CA', DateFormatter::FULL, DateFormatter::FULL); $fmt_array = array( - $fmt1 , $fmt2 ,$fmt3 , $fmt4 ,$fmt5 + $fmt1 , $fmt2 ,$fmt3 ); $fmt_desc_array = array( - "DateType::SHORT, TimeType::SHORT", - "DateType::NONE, TimeType::NONE", "DateType::LONG, TimeType::LONG", "DateType::MEDIUM, TimeType::MEDIUM", "DateType::FULL, TimeType::FULL" @@ -89,38 +83,25 @@ Input text is : Thursday, December 18, 1969 8:49:59 AM PST ------------ -DateFormatter : DateType::SHORT, TimeType::SHORT Error : 'Date parsing failed: U_PARSE_ERROR' ------------- -DateFormatter : DateType::NONE, TimeType::NONE Error : 'Date parsing failed: U_PARSE_ERROR' ------------- DateFormatter : DateType::LONG, TimeType::LONG Error : 'Date parsing failed: U_PARSE_ERROR' ------------ DateFormatter : DateType::MEDIUM, TimeType::MEDIUM Error : 'Date parsing failed: U_PARSE_ERROR' ------------ DateFormatter : DateType::FULL, TimeType::FULL -tm_sec : '59' , tm_min : '49' , tm_hour : '8' , tm_year : '69' , tm_mday : '18' , tm_wday : '5' , tm_yday : '352' , tm_mon : '11' , tm_isdst : '0' , +tm_sec : '59' , tm_min : '49' , tm_hour : '8' , tm_year : '69' , tm_mday : '18' , tm_wday : '4' , tm_yday : '352' , tm_mon : '11' , tm_isdst : '0' , ------------------------------- -Input text is : June 18, 1969 8:49:59 AM PST ------------- -DateFormatter : DateType::SHORT, TimeType::SHORT Error : 'Date parsing failed: U_PARSE_ERROR' +Input text is : June 18, 1969 8:49:59 AM ------------ -DateFormatter : DateType::NONE, TimeType::NONE Error : 'Date parsing failed: U_PARSE_ERROR' ------------- -DateFormatter : DateType::LONG, TimeType::LONG -tm_sec : '59' , tm_min : '49' , tm_hour : '9' , tm_year : '69' , tm_mday : '18' , tm_wday : '4' , tm_yday : '169' , tm_mon : '5' , tm_isdst : '1' , +DateFormatter : DateType::LONG, TimeType::LONG Error : 'Date parsing failed: U_PARSE_ERROR' ------------ DateFormatter : DateType::MEDIUM, TimeType::MEDIUM -tm_sec : '59' , tm_min : '49' , tm_hour : '8' , tm_year : '69' , tm_mday : '18' , tm_wday : '4' , tm_yday : '169' , tm_mon : '5' , tm_isdst : '1' , +tm_sec : '59' , tm_min : '49' , tm_hour : '8' , tm_year : '69' , tm_mday : '18' , tm_wday : '3' , tm_yday : '169' , tm_mon : '5' , tm_isdst : '1' , ------------ DateFormatter : DateType::FULL, TimeType::FULL Error : 'Date parsing failed: U_PARSE_ERROR' ------------------------------- -Input text is : 12/18/69 8:49:59 AM ------------- -DateFormatter : DateType::SHORT, TimeType::SHORT Error : 'Date parsing failed: U_PARSE_ERROR' ------------- -DateFormatter : DateType::NONE, TimeType::NONE Error : 'Date parsing failed: U_PARSE_ERROR' +Input text is : 12/18/69 8:49 AM ------------ DateFormatter : DateType::LONG, TimeType::LONG Error : 'Date parsing failed: U_PARSE_ERROR' ------------ @@ -129,11 +110,7 @@ DateFormatter : DateType::FULL, TimeType::FULL Error : 'Date parsing failed: U_PARSE_ERROR' ------------------------------- -Input text is : 19691218 08:49:59 AM ------------- -DateFormatter : DateType::SHORT, TimeType::SHORT Error : 'Date parsing failed: U_PARSE_ERROR' ------------- -DateFormatter : DateType::NONE, TimeType::NONE Error : 'Date parsing failed: U_PARSE_ERROR' +Input text is : 19691218 08:49 AM ------------ DateFormatter : DateType::LONG, TimeType::LONG Error : 'Date parsing failed: U_PARSE_ERROR' ------------ http://cvs.php.net/viewvc.cgi/pecl/intl/tests/dateformat_parse_timestamp_parsepos.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: pecl/intl/tests/dateformat_parse_timestamp_parsepos.phpt diff -u pecl/intl/tests/dateformat_parse_timestamp_parsepos.phpt:1.1.2.2 pecl/intl/tests/dateformat_parse_timestamp_parsepos.phpt:1.1.2.3 --- pecl/intl/tests/dateformat_parse_timestamp_parsepos.phpt:1.1.2.2 Fri Mar 21 23:59:28 2008 +++ pecl/intl/tests/dateformat_parse_timestamp_parsepos.phpt Thu Apr 3 20:54:07 2008 @@ -134,4 +134,4 @@ datetype = 3 ,timetype =3 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR' datetype = -1 ,timetype =-1 -Parsed text is : -1149060 \ No newline at end of file +Parsed text is : -1149060
« previous php.pecl.cvs (#10296) next »