mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
parent
18ee80a743
commit
96819b7bd9
@ -177,6 +177,7 @@ class ImageRepo
|
||||
|
||||
$image->refresh();
|
||||
$image->updated_by = user()->id;
|
||||
$image->touch();
|
||||
$image->save();
|
||||
$this->imageService->replaceExistingFromUpload($image->path, $image->type, $file);
|
||||
$this->loadThumbs($image, true);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user