public function test_file_deletion() { $page = \BookStack\Page::first(); $this->asAdmin(); $fileName = 'deletion_test.txt'; $this->uploadFile($fileName, $page->id); $filePath = base_path('storage/' . $this->getUploadPath($fileName)); $this->assertTrue(file_exists($filePath), 'File at path ' . $filePath . ' does not exist'); $attachmentId = \BookStack\Attachment::first()->id; $this->call('DELETE', 'attachments/' . $attachmentId); $this->dontSeeInDatabase('attachments', ['name' => $fileName]); $this->assertFalse(file_exists($filePath), 'File at path ' . $filePath . ' was not deleted as expected'); $this->deleteUploads(); }