derick Tue May 30 13:15:10 2006 UTC Modified files: /php-src/ext/date/tests bug37616.phpt date_constants.phpt Log: - Now as text and not HTML.
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/tests/bug37616.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/date/tests/bug37616.phpt diff -u php-src/ext/date/tests/bug37616.phpt:1.1 php-src/ext/date/tests/bug37616.phpt:1.2 --- php-src/ext/date/tests/bug37616.phpt:1.1 Tue May 30 13:08:00 2006 +++ php-src/ext/date/tests/bug37616.phpt Tue May 30 13:15:10 2006 @@ -1,3 +1,9 @@ -<code><span style="color: #000000"> ---TEST--<br />Bug #37616 (DATE_RFC822 does not product RFC 822 dates)<br />--FILE--<br /><span style="color: #0000BB"><?php<br /> date_default_timezone_set</span><span style="color: #007700">(</span><span style="color: #DD0000">"Europe/Oslo"</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #0000BB">DATE_RFC822</span><span style="color: #007700">, </span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"1 Jul 06 14:27:30 +0200"</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB">?><br /></span>--EXPECT--<br />string(29) "Sat, 01 Jul 06 14:27:30 +0200"<br /></span> -</code> \ No newline at end of file +--TEST-- +Bug #37616 (DATE_RFC822 does not product RFC 822 dates) +--FILE-- +<?php + date_default_timezone_set("Europe/Oslo"); + var_dump(date(DATE_RFC822, strtotime("1 Jul 06 14:27:30 +0200"))); +?> +--EXPECT-- +string(29) "Sat, 01 Jul 06 14:27:30 +0200" http://cvs.php.net/viewcvs.cgi/php-src/ext/date/tests/date_constants.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/date/tests/date_constants.phpt diff -u php-src/ext/date/tests/date_constants.phpt:1.1 php-src/ext/date/tests/date_constants.phpt:1.2 --- php-src/ext/date/tests/date_constants.phpt:1.1 Tue May 30 13:08:00 2006 +++ php-src/ext/date/tests/date_constants.phpt Tue May 30 13:15:10 2006 @@ -1,3 +1,44 @@ -<code><span style="color: #000000"> ---TEST--<br />Date constants<br />--FILE--<br /><span style="color: #0000BB"><?php<br /> date_default_timezone_set</span><span style="color: #007700">(</span><span style="color: #DD0000">"Europe/Oslo"</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">$constants </span><span style="color: #007700">= array(<br /> </span><span style="color: #0000BB">DATE_ATOM</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_COOKIE</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_ISO8601</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_RFC822</span><span style="color: #007700">,<br /> &! nbsp; </span><span style="color: #0000BB">DATE_RFC850</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_RFC1036</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_RFC1123</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_RFC2822</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_RSS</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">DATE_W3C<br /> </span><span style="color: #007700">);<br /> <br /> foreach(</span><span style="color: #0000BB">$constants </span><span style="color: #007700">as </spa! n><span style="color: #0000BB">$const</span><span style="color: #00770 0">) {<br /> </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #0000BB">$const</span><span style="color: #007700">, </span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"1 Jul 06 14:27:30 +0200"</span><span style="color: #007700">)));<br /> </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #0000BB">$const</span><span style="color: #007700">, </span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"2006-05-30T14:32:13+02:00"</span><span style="color: #007700">! )));<br /> }<br /></span><span style="color: #0000BB">?><br /></span>--EXPECT--<br />string(25) "2006-07-01T14:27:30+02:00"<br />string(25) "2006-05-30T14:32:13+02:00"<br />string(31) "Sat, 01 Jul 2006 14:27:30 +0200"<br />string(31) "Tue, 30 May 2006 14:32:13 +0200"<br />string(24) "2006-07-01T14:27:30+0200"<br />string(24) "2006-05-30T14:32:13+0200"<br />string(29) "Sat, 01 Jul 06 14:27:30 +0200"<br />string(29) "Tue, 30 May 06 14:32:13 +0200"<br />string(33) "Saturday, 01-Jul-06 14:27:30 CEST"<br />string(32) "Tuesday, 30-May-06 14:32:13 CEST"<br />string(29) "Sat, 01 Jul 06 14:27:30 +0200"<br />string(29) "Tue, 30 May 06 14:32:13 +0200"<br />string(31) "Sat, 01 Jul 2006 14:27:30 ! +0200"<br />string(31) "Tue, 30 May 2006 14:3 2:13 +0200"<br />string(31) "Sat, 01 Jul 2006 14:27:30 +0200"<br />string(31) "Tue, 30 May 2006 14:32:13 +0200"<br />string(31) "Sat, 01 Jul 2006 14:27:30 +0200"<br />string(31) "Tue, 30 May 2006 14:32:13 +0200"<br />string(25) "2006-07-01T14:27:30+02:00"<br />string(25) "2006-05-30T14:32:13+02:00"<br /></span> -</code> \ No newline at end of file +--TEST-- +Date constants +--FILE-- +<?php + date_default_timezone_set("Europe/Oslo"); + $constants = array( + DATE_ATOM, + DATE_COOKIE, + DATE_ISO8601, + DATE_RFC822, + DATE_RFC850, + DATE_RFC1036, + DATE_RFC1123, + DATE_RFC2822, + DATE_RSS, + DATE_W3C + ); + + foreach($constants as $const) { + var_dump(date($const, strtotime("1 Jul 06 14:27:30 +0200"))); + var_dump(date($const, strtotime("2006-05-30T14:32:13+02:00"))); + } +?> +--EXPECT-- +string(25) "2006-07-01T14:27:30+02:00" +string(25) "2006-05-30T14:32:13+02:00" +string(31) "Sat, 01 Jul 2006 14:27:30 +0200" +string(31) "Tue, 30 May 2006 14:32:13 +0200" +string(24) "2006-07-01T14:27:30+0200" +string(24) "2006-05-30T14:32:13+0200" +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" +string(32) "Tuesday, 30-May-06 14:32:13 CEST" +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(31) "Sat, 01 Jul 2006 14:27:30 +0200" +string(31) "Tue, 30 May 2006 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(25) "2006-07-01T14:27:30+02:00" +string(25) "2006-05-30T14:32:13+02:00"
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php