fix fragile tests depending on timezone
authorMichael Wallner <mike@php.net>
Fri, 22 Mar 2013 19:58:27 +0000 (19:58 +0000)
committerMichael Wallner <mike@php.net>
Fri, 22 Mar 2013 19:58:27 +0000 (19:58 +0000)
phpunit/CookieTest.php
phpunit/MessageTest.php

index affe798dbb647c7bf130a02ffb472635e4ff065e..11342adf6dfe763eb1090b60b5fd3cbe401c3158 100644 (file)
@@ -83,7 +83,9 @@ class CookieTest extends PHPUnit_Framework_TestCase {
         $this->assertEquals(
             sprintf(
                 "this=expires; expires=%s; ", 
-                date_create("@$t")->format("D, d M Y H:i:s \\G\\M\\T")
+                date_create("@$t")
+                       ->setTimezone(new DateTimezone("UTC"))
+                       ->format("D, d M Y H:i:s \\G\\M\\T")
             ), 
             $o->toString()
         );
index 485d431e4cfb0b037ce45dc4c587a7f8841e6acf..63bc226d430ea7e2663531b3f54877e6cf53eb04 100644 (file)
@@ -141,7 +141,7 @@ class MessageTest extends PHPUnit_Framework_TestCase
                        array(
                                array(
                                        "cookies" => array("foo" => "bar"),
-                                       "expires" => date_create("2012-12-31 23:59:59")->format(
+                                       "expires" => date_create("2012-12-31 22:59:59 GMT")->format(
                                                DateTime::COOKIE
                                        ),
                                        "path" => "/somewhere"