X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/7b6c88f17c595f3b0d88fe383827794b83dba3e7..refs/pull/364/head:/tests/ImageTest.php diff --git a/tests/ImageTest.php b/tests/ImageTest.php index 806a36acc..3bb41138b 100644 --- a/tests/ImageTest.php +++ b/tests/ImageTest.php @@ -1,6 +1,6 @@ -uploadImage($imageName, $page->id); $this->assertResponseOk(); - $this->assertTrue(file_exists(public_path($relPath)), 'Uploaded image exists'); + $this->assertTrue(file_exists(public_path($relPath)), 'Uploaded image not found at path: '. public_path($relPath)); + + $this->deleteImage($relPath); $this->seeInDatabase('images', [ - 'url' => $relPath, + 'url' => $this->baseUrl . $relPath, 'type' => 'gallery', 'uploaded_to' => $page->id, 'path' => $relPath, @@ -68,8 +70,7 @@ class ImageTest extends TestCase 'updated_by' => $admin->id, 'name' => $imageName ]); - - $this->deleteImage($relPath); + } public function test_image_delete() @@ -85,11 +86,11 @@ class ImageTest extends TestCase $this->assertResponseOk(); $this->dontSeeInDatabase('images', [ - 'url' => $relPath, + 'url' => $this->baseUrl . $relPath, 'type' => 'gallery' ]); - $this->assertFalse(file_exists(public_path($relPath)), 'Uploaded image has been deleted'); + $this->assertFalse(file_exists(public_path($relPath)), 'Uploaded image has not been deleted as expected'); } } \ No newline at end of file