Skip to content

Commit d05b49a

Browse files
committed
Fixing a fragile Time test that keeps causing us to look like we're failing.
1 parent b79a421 commit d05b49a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/system/I18n/TimeTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,13 @@ public function testCreateFromTimeLocalized()
185185

186186
public function testCreateFromFormat()
187187
{
188+
$now = new \DateTime('now');
189+
190+
Time::setTestNow($now);
188191
$time = Time::createFromFormat('F j, Y', 'January 15, 2017', 'America/Chicago');
189192

190-
$this->assertEquals(date('2017-01-15 H:i:s'), $time->toDateTimeString());
193+
$this->assertEquals(date('2017-01-15 H:i:s', $now->getTimestamp()), $time->toDateTimeString());
194+
Time::setTestNow();
191195
}
192196

193197
public function testCreateFromFormatWithTimezoneString()

0 commit comments

Comments
 (0)