From dd7d6e44b95a16ba96dd147054fb8536438c8c7c Mon Sep 17 00:00:00 2001 From: "J. King" Date: Sat, 16 Dec 2017 19:37:30 -0500 Subject: [PATCH] Further fixes for test timezone assumptions --- tests/cases/Misc/TestValueInfo.php | 2 +- tests/lib/Db/BindingTests.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cases/Misc/TestValueInfo.php b/tests/cases/Misc/TestValueInfo.php index 8100ff7..039a21e 100644 --- a/tests/cases/Misc/TestValueInfo.php +++ b/tests/cases/Misc/TestValueInfo.php @@ -456,7 +456,7 @@ class TestValueInfo extends Test\AbstractTest { ["Fri, 01 Jan 2010 00:00:00 GMT", null, null, null, $this->t(1262304000), null, null, null, null, null, null, $this->t(1262304000), ], ["2010-01-01 00:00:00", null, null, null, null, $this->t(1262304000), null, null, null, null, null, $this->t(1262304000), ], ["2010-01-01", null, null, null, null, null, $this->t(1262304000), null, null, null, null, $this->t(1262304000), ], - ["12:34:56", null, null, null, null, null, null, $this->t(45296), null, null, null, $this->t(strtotime("Today UTC")+45296), ], + ["12:34:56", null, null, null, null, null, null, $this->t(45296), null, null, null, $this->t(date_create("today", new \DateTimezone("UTC"))->getTimestamp()+45296), ], ["1262304000", null, null, null, null, null, null, null, $this->t(1262304000), null, null, null, ], ["1262304000.123456", null, null, null, null, null, null, null, null, $this->t(1262304000.123456), null, null, ], ["1262304000.42", null, null, null, null, null, null, null, null, $this->t(1262304000.42), null, null, ], diff --git a/tests/lib/Db/BindingTests.php b/tests/lib/Db/BindingTests.php index a537a4e..5ba5ff3 100644 --- a/tests/lib/Db/BindingTests.php +++ b/tests/lib/Db/BindingTests.php @@ -213,7 +213,7 @@ trait BindingTests { public function testBindArbitraryDateString() { $input = "Today"; - $time = strtotime($input." UTC"); + $time = date_create($input, new \DateTimezone("UTC"))->getTimestamp(); $exp = [ "null" => null, "integer" => 0,