Skip to content

Commit

Permalink
Fix volatile time comparison in insert batch testing
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalandan committed Nov 16, 2020
1 parent 1d2eecc commit 327445e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/system/Database/Live/ModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1396,10 +1396,10 @@ public function testInsertBatchSetsIntTimestamps()
{
$job_data = [
[
'name' => 'Philosopher',
'name' => 'Philosopher',
],
[
'name' => 'Laborer',
'name' => 'Laborer',
],
];

Expand All @@ -1409,7 +1409,7 @@ public function testInsertBatchSetsIntTimestamps()

$result = $model->where('name', 'Philosopher')->first();

$this->assertEquals(time(), $result->created_at);
$this->assertCloseEnough(time(), $result->created_at);
}

public function testInsertBatchSetsDatetimeTimestamps()
Expand All @@ -1433,7 +1433,7 @@ public function testInsertBatchSetsDatetimeTimestamps()

$result = $model->where('name', 'Lou')->first();

$this->assertEquals(time(), strtotime($result->created_at));
$this->assertCloseEnough(time(), strtotime($result->created_at));
}

//--------------------------------------------------------------------
Expand Down

0 comments on commit 327445e

Please sign in to comment.