mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-01 22:39:13 +08:00
Drawings now generate revisions, not replace
Updated drawing update test to accomodate. Image deletion system now takes revisions into account.
This commit is contained in:
@ -210,7 +210,7 @@ class ImageTest extends TestCase
|
||||
$this->assertTrue($testImageData === $uploadedImageData, "Uploaded image file data does not match our test image as expected");
|
||||
}
|
||||
|
||||
public function test_drawing_replacing()
|
||||
public function test_drawing_updating()
|
||||
{
|
||||
$page = Page::first();
|
||||
$editor = $this->getEditor();
|
||||
@ -235,6 +235,15 @@ class ImageTest extends TestCase
|
||||
'updated_by' => $editor->id,
|
||||
]);
|
||||
|
||||
// Check a revision has been created
|
||||
$this->assertDatabaseHas('image_revisions', [
|
||||
'image_id' => $image->id,
|
||||
'revision' => 2,
|
||||
'created_by' => $editor->id,
|
||||
]);
|
||||
|
||||
$image = Image::find($image->id);
|
||||
|
||||
$this->assertTrue(file_exists(public_path($image->path)), 'Uploaded image not found at path: '. public_path($image->path));
|
||||
|
||||
$testImageData = file_get_contents($this->getTestImageFilePath());
|
||||
|
Reference in New Issue
Block a user