X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/08b39500b3b27181a7a1a0e4ee51dabce45673c2..refs/pull/4615/head:/tests/Helpers/EntityProvider.php diff --git a/tests/Helpers/EntityProvider.php b/tests/Helpers/EntityProvider.php index 8b045db54..3cb8c44d3 100644 --- a/tests/Helpers/EntityProvider.php +++ b/tests/Helpers/EntityProvider.php @@ -2,7 +2,6 @@ namespace Tests\Helpers; -use BookStack\Auth\User; use BookStack\Entities\Models\Book; use BookStack\Entities\Models\Bookshelf; use BookStack\Entities\Models\Chapter; @@ -12,6 +11,8 @@ use BookStack\Entities\Repos\BookRepo; use BookStack\Entities\Repos\BookshelfRepo; use BookStack\Entities\Repos\ChapterRepo; use BookStack\Entities\Repos\PageRepo; +use BookStack\Entities\Tools\TrashCan; +use BookStack\Users\Models\User; use Illuminate\Database\Eloquent\Builder; /** @@ -197,6 +198,16 @@ class EntityProvider return $draftPage; } + /** + * Fully destroy the given entity from the system, bypassing the recycle bin + * stage. Still runs through main app deletion logic. + */ + public function destroy(Entity $entity) + { + $trash = app()->make(TrashCan::class); + $trash->destroyEntity($entity); + } + /** * @param Entity|Entity[] $entities */