X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/948e95e1ad89ed9e20e37cef2233f2387c634d10..refs/pull/4467/head:/tests/Uploads/ImageTest.php diff --git a/tests/Uploads/ImageTest.php b/tests/Uploads/ImageTest.php index f9cc419a4..a9684eef7 100644 --- a/tests/Uploads/ImageTest.php +++ b/tests/Uploads/ImageTest.php @@ -104,11 +104,18 @@ class ImageTest extends TestCase $this->assertFileEquals($this->files->testFilePath('test-image.png'), public_path($relPath)); $imageId = $imgDetails['response']->id; + $image = Image::findOrFail($imageId); + $image->updated_at = now()->subMonth(); + $image->save(); + $this->call('PUT', "/images/{$imageId}/file", [], [], ['file' => $newUpload]) ->assertOk(); $this->assertFileEquals($this->files->testFilePath('compressed.png'), public_path($relPath)); + $image->refresh(); + $this->assertTrue($image->updated_at->gt(now()->subMinute())); + $this->files->deleteAtRelativePath($relPath); }