mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-30 07:32:39 +01:00
parent
5fd1c07c9d
commit
832356d56e
@ -8,6 +8,7 @@ use BookStack\Entities\Models\Bookshelf;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
use BookStack\Entities\Models\Entity;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use Exception;
|
||||
use Illuminate\Support\Str;
|
||||
use Tests\TestCase;
|
||||
|
||||
@ -653,4 +654,22 @@ class EntityPermissionsTest extends TestCase
|
||||
]);
|
||||
$resp->assertRedirect($book->getUrl('/page/test-page'));
|
||||
}
|
||||
|
||||
public function test_book_permissions_can_be_generated_without_error_if_child_chapter_is_in_recycle_bin()
|
||||
{
|
||||
$book = $this->entities->bookHasChaptersAndPages();
|
||||
/** @var Chapter $chapter */
|
||||
$chapter = $book->chapters()->first();
|
||||
|
||||
$this->asAdmin()->delete($chapter->getUrl());
|
||||
|
||||
$error = null;
|
||||
try {
|
||||
$this->entities->setPermissions($book, ['view'], []);
|
||||
} catch (Exception $e) {
|
||||
$error = $e;
|
||||
}
|
||||
|
||||
$this->assertNull($error);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user