Skip to content

Commit

Permalink
Add deltas to time based tests which may have an off by one due to th…
Browse files Browse the repository at this point in the history
…e clock ticking
  • Loading branch information
ben-xo committed Sep 24, 2023
1 parent 145b6d9 commit cf1b627
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/Cached_Dir_PodcastTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function test_lastBuildDate_is_valid_whether_served_from_cache_or_not()
clearstatcache();
$this->assertTrue($mp->isCached());

$this->assertEquals($lastBuildDate, $mp->getLastBuildDate());
$this->assertEquals($lastBuildDate, $mp->getLastBuildDate(), "build date", 1.0);
unset($mp); // release lock, in sub tests

age_dir_by('.', 3600);
Expand All @@ -155,7 +155,7 @@ public function test_lastBuildDate_is_valid_whether_served_from_cache_or_not()
clearstatcache();
$this->assertTrue($mp2->isCached());

$this->assertEquals($lastBuildDate, $mp2->getLastBuildDate());
$this->assertEquals($lastBuildDate, $mp2->getLastBuildDate(), "build date", 1.0);
unset($mp2);

clearstatcache();
Expand All @@ -165,7 +165,7 @@ public function test_lastBuildDate_is_valid_whether_served_from_cache_or_not()
$mp3->generate();

clearstatcache();
$this->assertEquals($lastBuildDate, $mp3->getLastBuildDate());
$this->assertEquals($lastBuildDate, $mp3->getLastBuildDate(), "build date", 1.0);
}

public function tearDown(): void
Expand Down

0 comments on commit cf1b627

Please sign in to comment.