Skip to content

Commit b3d170d

Browse files
authored
Merge pull request #1736 from jim-parry/travis/timing
Accommodate long travis execution times
2 parents 0cd3bff + 5f93d9a commit b3d170d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/system/EntityTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function testDateMutationFromTimestamp()
174174
$time = $entity->created_at;
175175

176176
$this->assertInstanceOf(Time::class, $time);
177-
$this->assertEquals(date('Y-m-d H:i:s', $stamp), $time->format('Y-m-d H:i:s'));
177+
$this->assertCloseEnoughString(date('Y-m-d H:i:s', $stamp), $time->format('Y-m-d H:i:s'));
178178
}
179179

180180
public function testDateMutationFromDatetime()
@@ -186,7 +186,7 @@ public function testDateMutationFromDatetime()
186186
$time = $entity->created_at;
187187

188188
$this->assertInstanceOf(Time::class, $time);
189-
$this->assertEquals($dt->format('Y-m-d H:i:s'), $time->format('Y-m-d H:i:s'));
189+
$this->assertCloseEnoughString($dt->format('Y-m-d H:i:s'), $time->format('Y-m-d H:i:s'));
190190
}
191191

192192
public function testDateMutationFromTime()
@@ -198,7 +198,7 @@ public function testDateMutationFromTime()
198198
$time = $entity->created_at;
199199

200200
$this->assertInstanceOf(Time::class, $time);
201-
$this->assertEquals($dt->format('Y-m-d H:i:s'), $time->format('Y-m-d H:i:s'));
201+
$this->assertCloseEnoughString($dt->format('Y-m-d H:i:s'), $time->format('Y-m-d H:i:s'));
202202
}
203203

204204
public function testDateMutationStringToTime()
@@ -223,7 +223,7 @@ public function testDateMutationTimestampToTime()
223223
$time = $this->getPrivateProperty($entity, 'created_at');
224224

225225
$this->assertInstanceOf(Time::class, $time);
226-
$this->assertEquals(date('Y-m-d H:i:s'), $time->format('Y-m-d H:i:s'));
226+
$this->assertCloseEnoughString(date('Y-m-d H:i:s'), $time->format('Y-m-d H:i:s'));
227227
}
228228

229229
public function testDateMutationDatetimeToTime()
@@ -236,7 +236,7 @@ public function testDateMutationDatetimeToTime()
236236
$time = $this->getPrivateProperty($entity, 'created_at');
237237

238238
$this->assertInstanceOf(Time::class, $time);
239-
$this->assertEquals($dt->format('Y-m-d H:i:s'), $time->format('Y-m-d H:i:s'));
239+
$this->assertCloseEnoughString($dt->format('Y-m-d H:i:s'), $time->format('Y-m-d H:i:s'));
240240
}
241241

242242
public function testDateMutationTimeToTime()
@@ -249,7 +249,7 @@ public function testDateMutationTimeToTime()
249249
$time = $this->getPrivateProperty($entity, 'created_at');
250250

251251
$this->assertInstanceOf(Time::class, $time);
252-
$this->assertEquals($dt->format('Y-m-d H:i:s'), $time->format('Y-m-d H:i:s'));
252+
$this->assertCloseEnoughString($dt->format('Y-m-d H:i:s'), $time->format('Y-m-d H:i:s'));
253253
}
254254

255255
//--------------------------------------------------------------------

tests/system/I18n/TimeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public function testCreateFromTimeLocalized()
167167
{
168168
$time = Time::createFromTime(10, 03, 05, 'Europe/London');
169169

170-
$this->assertEquals(date('Y-m-d 10:03:05'), $time->toDateTimeString());
170+
$this->assertCloseEnoughString(date('Y-m-d 10:03:05'), $time->toDateTimeString());
171171
}
172172

173173
public function testCreateFromFormat()
@@ -177,7 +177,7 @@ public function testCreateFromFormat()
177177
Time::setTestNow($now);
178178
$time = Time::createFromFormat('F j, Y', 'January 15, 2017', 'America/Chicago');
179179

180-
$this->assertEquals(date('2017-01-15 H:i:s', $now->getTimestamp()), $time->toDateTimeString());
180+
$this->assertCloseEnoughString(date('2017-01-15 H:i:s', $now->getTimestamp()), $time->toDateTimeString());
181181
Time::setTestNow();
182182
}
183183

0 commit comments

Comments
 (0)