Showing
1 changed file
with
5 additions
and
4 deletions
| ... | @@ -57,10 +57,12 @@ class ImageTest extends TestCase | ... | @@ -57,10 +57,12 @@ class ImageTest extends TestCase |
| 57 | $relPath = $this->uploadImage($imageName, $page->id); | 57 | $relPath = $this->uploadImage($imageName, $page->id); |
| 58 | $this->assertResponseOk(); | 58 | $this->assertResponseOk(); |
| 59 | 59 | ||
| 60 | - $this->assertTrue(file_exists(public_path($relPath)), 'Uploaded image exists'); | 60 | + $this->assertTrue(file_exists(public_path($relPath)), 'Uploaded image not found at path: '. public_path($relPath)); |
| 61 | + | ||
| 62 | + $this->deleteImage($relPath); | ||
| 61 | 63 | ||
| 62 | $this->seeInDatabase('images', [ | 64 | $this->seeInDatabase('images', [ |
| 63 | - 'url' => $relPath, | 65 | + 'url' => url($relPath), |
| 64 | 'type' => 'gallery', | 66 | 'type' => 'gallery', |
| 65 | 'uploaded_to' => $page->id, | 67 | 'uploaded_to' => $page->id, |
| 66 | 'path' => $relPath, | 68 | 'path' => $relPath, |
| ... | @@ -68,8 +70,7 @@ class ImageTest extends TestCase | ... | @@ -68,8 +70,7 @@ class ImageTest extends TestCase |
| 68 | 'updated_by' => $admin->id, | 70 | 'updated_by' => $admin->id, |
| 69 | 'name' => $imageName | 71 | 'name' => $imageName |
| 70 | ]); | 72 | ]); |
| 71 | - | 73 | + |
| 72 | - $this->deleteImage($relPath); | ||
| 73 | } | 74 | } |
| 74 | 75 | ||
| 75 | public function test_image_delete() | 76 | public function test_image_delete() | ... | ... |
-
Please register or sign in to post a comment