Skip to content

Commit

Permalink
Add comment about test sleep()
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-xo committed Dec 29, 2021
1 parent fb2f233 commit 45ade36
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/CachingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,12 @@ public function test_too_new_file_not_included_in_podcast(): void
$old_mtime = filemtime($cached_output_files[0]);

file_put_contents('empty.mp3', 'test');
touch('empty.mp3'); // too new to be included because of min-file-age, but still busts cache
// FIXME: its presence busts the cache anyway, which is not how it's supposed to work
touch('empty.mp3'); // too new to be included because of min-file-age

// this sleep guarantees that the Last Modified will be different IF the feed is regenerated
// (which it shouldn't be!)
sleep(1);

exec('php dir2cast.php --output=out.xml --dont-uncache --min-file-age=30 --ignore-dir2cast-mtime');

$new_content = file_get_contents($this->file); // should not have empty.mp3
Expand Down

0 comments on commit 45ade36

Please sign in to comment.