diff --git a/ext/date/tests/DateTimeImmutable_constants.phpt b/ext/date/tests/DateTimeImmutable_constants.phpt index a3e7c0c8d8f7..fc0a2d4dc978 100644 --- a/ext/date/tests/DateTimeImmutable_constants.phpt +++ b/ext/date/tests/DateTimeImmutable_constants.phpt @@ -4,17 +4,20 @@ DateTimeImmutable constants @@ -30,3 +33,6 @@ bool(true) bool(true) bool(true) bool(true) +bool(true) +bool(true) +bool(true) diff --git a/ext/date/tests/DateTimeInterface_constants.phpt b/ext/date/tests/DateTimeInterface_constants.phpt index 972714c3172e..a9e136e89c25 100644 --- a/ext/date/tests/DateTimeInterface_constants.phpt +++ b/ext/date/tests/DateTimeInterface_constants.phpt @@ -4,17 +4,20 @@ DateTimeInterface constants @@ -30,3 +33,6 @@ bool(true) bool(true) bool(true) bool(true) +bool(true) +bool(true) +bool(true) diff --git a/ext/date/tests/DateTime_constants.phpt b/ext/date/tests/DateTime_constants.phpt index 44e840176eae..ea8e636d81f1 100644 --- a/ext/date/tests/DateTime_constants.phpt +++ b/ext/date/tests/DateTime_constants.phpt @@ -4,17 +4,20 @@ DateTime constants @@ -30,3 +33,6 @@ bool(true) bool(true) bool(true) bool(true) +bool(true) +bool(true) +bool(true) diff --git a/ext/date/tests/DateTime_format_basic2.phpt b/ext/date/tests/DateTime_format_basic2.phpt index df38cf44c44c..5a8a0c8baab8 100644 --- a/ext/date/tests/DateTime_format_basic2.phpt +++ b/ext/date/tests/DateTime_format_basic2.phpt @@ -5,32 +5,38 @@ Test date_format() function : basic functionality //Set the default time zone date_default_timezone_set("Europe/London"); -echo "*** Testing date_format() : basic functionality - formatting coinstants ***\n"; +echo "*** Testing date_format() : basic functionality - formatting constants ***\n"; $date = new DateTime("2005-07-14 22:30:41"); var_dump( $date->format( DateTime::ATOM) ) ; var_dump( $date->format( DateTime::COOKIE) ) ; var_dump( $date->format( DateTime::ISO8601) ) ; +var_dump( $date->format( DateTime::ISO8601_EXPANDED) ) ; var_dump( $date->format( DateTime::RFC822) ) ; var_dump( $date->format( DateTime::RFC850) ) ; var_dump( $date->format( DateTime::RFC1036) ) ; var_dump( $date->format( DateTime::RFC1123) ) ; -var_dump( $date->format( DateTime:: RFC2822) ) ; +var_dump( $date->format( DateTime::RFC7231) ) ; +var_dump( $date->format( DateTime::RFC2822) ) ; var_dump( $date->format( DateTime::RFC3339) ) ; +var_dump( $date->format( DateTime::RFC3339_EXTENDED) ) ; var_dump( $date->format( DateTime::RSS) ) ; var_dump( $date->format( DateTime::W3C) ) ; ?> --EXPECT-- -*** Testing date_format() : basic functionality - formatting coinstants *** +*** Testing date_format() : basic functionality - formatting constants *** string(25) "2005-07-14T22:30:41+01:00" string(34) "Thursday, 14-Jul-2005 22:30:41 BST" string(24) "2005-07-14T22:30:41+0100" +string(26) "+2005-07-14T22:30:41+01:00" string(29) "Thu, 14 Jul 05 22:30:41 +0100" string(32) "Thursday, 14-Jul-05 22:30:41 BST" string(29) "Thu, 14 Jul 05 22:30:41 +0100" string(31) "Thu, 14 Jul 2005 22:30:41 +0100" +string(29) "Thu, 14 Jul 2005 22:30:41 GMT" string(31) "Thu, 14 Jul 2005 22:30:41 +0100" string(25) "2005-07-14T22:30:41+01:00" +string(29) "2005-07-14T22:30:41.000+01:00" string(31) "Thu, 14 Jul 2005 22:30:41 +0100" string(25) "2005-07-14T22:30:41+01:00" diff --git a/ext/date/tests/date_constants.phpt b/ext/date/tests/date_constants.phpt index 043b6b45cd8c..7f60dc4c30a9 100644 --- a/ext/date/tests/date_constants.phpt +++ b/ext/date/tests/date_constants.phpt @@ -7,12 +7,15 @@ Date constants DATE_ATOM, DATE_COOKIE, DATE_ISO8601, + DATE_ISO8601_EXPANDED, DATE_RFC822, DATE_RFC850, DATE_RFC1036, DATE_RFC1123, + DATE_RFC7231, DATE_RFC2822, DATE_RFC3339, + DATE_RFC3339_EXTENDED, DATE_RSS, DATE_W3C ); @@ -25,17 +28,20 @@ Date constants print "\n"; var_dump( - DATE_ATOM == DateTime::ATOM, - DATE_COOKIE == DateTime::COOKIE, - DATE_ISO8601 == DateTime::ISO8601, - DATE_RFC822 == DateTime::RFC822, - DATE_RFC850 == DateTime::RFC850, - DATE_RFC1036 == DateTime::RFC1036, - DATE_RFC1123 == DateTime::RFC1123, - DATE_RFC2822 == DateTime::RFC2822, - DATE_RFC3339 == DateTime::RFC3339, - DATE_RSS == DateTime::RSS, - DATE_W3C == DateTime::W3C + DATE_ATOM == DateTime::ATOM, + DATE_COOKIE == DateTime::COOKIE, + DATE_ISO8601 == DateTime::ISO8601, + DATE_ISO8601_EXPANDED == DateTime::ISO8601_EXPANDED, + DATE_RFC822 == DateTime::RFC822, + DATE_RFC850 == DateTime::RFC850, + DATE_RFC1036 == DateTime::RFC1036, + DATE_RFC1123 == DateTime::RFC1123, + DATE_RFC2822 == DateTime::RFC2822, + DATE_RFC7231 == DateTime::RFC7231, + DATE_RFC3339 == DateTime::RFC3339, + DATE_RFC3339_EXTENDED == DateTime::RFC3339_EXTENDED, + DATE_RSS == DateTime::RSS, + DATE_W3C == DateTime::W3C ); ?> --EXPECT-- @@ -45,6 +51,8 @@ string(35) "Saturday, 01-Jul-2006 14:27:30 CEST" string(34) "Tuesday, 30-May-2006 14:32:13 CEST" string(24) "2006-07-01T14:27:30+0200" string(24) "2006-05-30T14:32:13+0200" +string(26) "+2006-07-01T14:27:30+02:00" +string(26) "+2006-05-30T14:32:13+02:00" string(29) "Sat, 01 Jul 06 14:27:30 +0200" string(29) "Tue, 30 May 06 14:32:13 +0200" string(33) "Saturday, 01-Jul-06 14:27:30 CEST" @@ -53,10 +61,14 @@ string(29) "Sat, 01 Jul 06 14:27:30 +0200" string(29) "Tue, 30 May 06 14:32:13 +0200" string(31) "Sat, 01 Jul 2006 14:27:30 +0200" string(31) "Tue, 30 May 2006 14:32:13 +0200" +string(29) "Sat, 01 Jul 2006 14:27:30 GMT" +string(29) "Tue, 30 May 2006 14:32:13 GMT" string(31) "Sat, 01 Jul 2006 14:27:30 +0200" string(31) "Tue, 30 May 2006 14:32:13 +0200" string(25) "2006-07-01T14:27:30+02:00" string(25) "2006-05-30T14:32:13+02:00" +string(29) "2006-07-01T14:27:30.000+02:00" +string(29) "2006-05-30T14:32:13.000+02:00" string(31) "Sat, 01 Jul 2006 14:27:30 +0200" string(31) "Tue, 30 May 2006 14:32:13 +0200" string(25) "2006-07-01T14:27:30+02:00" @@ -73,3 +85,6 @@ bool(true) bool(true) bool(true) bool(true) +bool(true) +bool(true) +bool(true) diff --git a/ext/date/tests/strtotime2.phpt b/ext/date/tests/strtotime2.phpt index c9b83838d1a0..f8477696a4a7 100644 --- a/ext/date/tests/strtotime2.phpt +++ b/ext/date/tests/strtotime2.phpt @@ -10,12 +10,14 @@ $constants = array( 'DATE_ATOM', 'DATE_COOKIE', 'DATE_ISO8601', + 'DATE_ISO8601_EXPANDED', 'DATE_RFC822', 'DATE_RFC850', 'DATE_RFC1036', 'DATE_RFC1123', 'DATE_RFC2822', 'DATE_RFC3339', + 'DATE_RFC3339_EXTENDED', 'DATE_RSS', 'DATE_W3C' ); @@ -30,11 +32,13 @@ foreach ($constants as $const) { DATE_ATOM: OK DATE_COOKIE: OK DATE_ISO8601: OK +DATE_ISO8601_EXPANDED: OK DATE_RFC822: OK DATE_RFC850: OK DATE_RFC1036: OK DATE_RFC1123: OK DATE_RFC2822: OK DATE_RFC3339: OK +DATE_RFC3339_EXTENDED: OK DATE_RSS: OK DATE_W3C: OK diff --git a/ext/date/tests/test-parse-from-format.phpt b/ext/date/tests/test-parse-from-format.phpt index 670a31685937..db03dc9a7006 100644 --- a/ext/date/tests/test-parse-from-format.phpt +++ b/ext/date/tests/test-parse-from-format.phpt @@ -3,8 +3,8 @@ date_create_from_format() and date_parse_from_format(). --FILE-- + string(26) "2008-07-08 22:14:12.000000" + ["timezone_type"]=> + int(1) + ["timezone"]=> + string(6) "+02:00" +} + string(16) "D, d M y H:i:s O" string(29) "Tue, 08 Jul 08 22:14:12 +0200" -object(DateTime)#2 (3) { +object(DateTime)#1 (3) { ["date"]=> string(26) "2008-07-08 22:14:12.000000" ["timezone_type"]=> @@ -67,7 +78,7 @@ object(DateTime)#2 (3) { string(16) "l, d-M-y H:i:s T" string(36) "Tuesday, 08-Jul-08 22:14:12 GMT+0200" -object(DateTime)#1 (3) { +object(DateTime)#3 (3) { ["date"]=> string(26) "2008-07-08 22:14:12.000000" ["timezone_type"]=> @@ -78,7 +89,7 @@ object(DateTime)#1 (3) { string(16) "D, d M y H:i:s O" string(29) "Tue, 08 Jul 08 22:14:12 +0200" -object(DateTime)#3 (3) { +object(DateTime)#2 (3) { ["date"]=> string(26) "2008-07-08 22:14:12.000000" ["timezone_type"]=> @@ -89,7 +100,7 @@ object(DateTime)#3 (3) { string(16) "D, d M Y H:i:s O" string(31) "Tue, 08 Jul 2008 22:14:12 +0200" -object(DateTime)#2 (3) { +object(DateTime)#1 (3) { ["date"]=> string(26) "2008-07-08 22:14:12.000000" ["timezone_type"]=> @@ -100,7 +111,7 @@ object(DateTime)#2 (3) { string(16) "D, d M Y H:i:s O" string(31) "Tue, 08 Jul 2008 22:14:12 +0200" -object(DateTime)#1 (3) { +object(DateTime)#3 (3) { ["date"]=> string(26) "2008-07-08 22:14:12.000000" ["timezone_type"]=> @@ -111,7 +122,18 @@ object(DateTime)#1 (3) { string(13) "Y-m-d\TH:i:sP" string(25) "2008-07-08T22:14:12+02:00" -object(DateTime)#3 (3) { +object(DateTime)#2 (3) { + ["date"]=> + string(26) "2008-07-08 22:14:12.000000" + ["timezone_type"]=> + int(1) + ["timezone"]=> + string(6) "+02:00" +} + +string(15) "Y-m-d\TH:i:s.vP" +string(29) "2008-07-08T22:14:12.000+02:00" +object(DateTime)#1 (3) { ["date"]=> string(26) "2008-07-08 22:14:12.000000" ["timezone_type"]=> @@ -122,7 +144,7 @@ object(DateTime)#3 (3) { string(16) "D, d M Y H:i:s O" string(31) "Tue, 08 Jul 2008 22:14:12 +0200" -object(DateTime)#2 (3) { +object(DateTime)#3 (3) { ["date"]=> string(26) "2008-07-08 22:14:12.000000" ["timezone_type"]=> @@ -133,7 +155,7 @@ object(DateTime)#2 (3) { string(13) "Y-m-d\TH:i:sP" string(25) "2008-07-08T22:14:12+02:00" -object(DateTime)#1 (3) { +object(DateTime)#2 (3) { ["date"]=> string(26) "2008-07-08 22:14:12.000000" ["timezone_type"]=>