From a5dac57bfda10f24d6f2fb5047b4c5408a97651d Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 22 Mar 2013 19:58:27 +0000 Subject: [PATCH] fix fragile tests depending on timezone --- phpunit/CookieTest.php | 4 +++- phpunit/MessageTest.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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" -- 2.30.2