From: Michael Wallner Date: Fri, 22 Mar 2013 19:58:27 +0000 (+0000) Subject: fix fragile tests depending on timezone X-Git-Tag: RELEASE_2_1_0_RC3~10^2^2~35 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=a5dac57bfda10f24d6f2fb5047b4c5408a97651d;p=m6w6%2Fext-http fix fragile tests depending on timezone --- diff --git a/phpunit/CookieTest.php b/phpunit/CookieTest.php index affe798..11342ad 100644 --- a/phpunit/CookieTest.php +++ b/phpunit/CookieTest.php @@ -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() ); diff --git a/phpunit/MessageTest.php b/phpunit/MessageTest.php index 485d431..63bc226 100644 --- a/phpunit/MessageTest.php +++ b/phpunit/MessageTest.php @@ -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"