]> BookStack Code Mirror - bookstack/blobdiff - tests/ImageTest.php
Page Attachments - Improved UI, Now initially complete
[bookstack] / tests / ImageTest.php
index 806a36acc11fcb507987ba4e9ab2fc6935afa2fd..234988ba402c18da448ac0d5714c86f4b88edc50 100644 (file)
@@ -10,7 +10,7 @@ class ImageTest extends TestCase
      */
     protected function getTestImage($fileName)
     {
-        return new \Illuminate\Http\UploadedFile(base_path('tests/test-image.jpg'), $fileName, 'image/jpeg', 5238);
+        return new \Illuminate\Http\UploadedFile(base_path('tests/test-data/test-image.jpg'), $fileName, 'image/jpeg', 5238);
     }
 
     /**
@@ -59,8 +59,10 @@ class ImageTest extends TestCase
 
         $this->assertTrue(file_exists(public_path($relPath)), 'Uploaded image exists');
 
+        $this->deleteImage($relPath);
+
         $this->seeInDatabase('images', [
-            'url' => $relPath,
+            'url' => $this->baseUrl . $relPath,
             'type' => 'gallery',
             'uploaded_to' => $page->id,
             'path' => $relPath,
@@ -69,7 +71,7 @@ class ImageTest extends TestCase
             'name' => $imageName
         ]);
         
-        $this->deleteImage($relPath);
+
     }
 
     public function test_image_delete()
@@ -85,7 +87,7 @@ class ImageTest extends TestCase
         $this->assertResponseOk();
 
         $this->dontSeeInDatabase('images', [
-            'url' => $relPath,
+            'url' => $this->baseUrl . $relPath,
             'type' => 'gallery'
         ]);