]> BookStack Code Mirror - bookstack/blobdiff - tests/Uploads/AttachmentTest.php
Code cleanup, bug squashing
[bookstack] / tests / Uploads / AttachmentTest.php
index 5838b019e4affb526e50472bf439285f0c24c865..1ca9ea23b17d5d04101c2203173d394b3455b379 100644 (file)
@@ -1,7 +1,9 @@
 <?php namespace Tests\Uploads;
 
+use BookStack\Entities\Tools\TrashCan;
+use BookStack\Entities\Repos\PageRepo;
 use BookStack\Uploads\Attachment;
-use BookStack\Entities\Page;
+use BookStack\Entities\Models\Page;
 use BookStack\Auth\Permissions\PermissionService;
 use BookStack\Uploads\AttachmentService;
 use Illuminate\Http\UploadedFile;
@@ -213,7 +215,8 @@ class AttachmentTest extends TestCase
             'name' => $fileName
         ]);
 
-        $this->call('DELETE', $page->getUrl());
+        app(PageRepo::class)->destroy($page);
+        app(TrashCan::class)->empty();
 
         $this->assertDatabaseMissing('attachments', [
             'name' => $fileName