use BookStack\Auth\Role;
use BookStack\Auth\User;
-use BookStack\Entities\Models\Bookshelf;
-use BookStack\Entities\Models\Page;
class HomepageTest extends TestCase
{
public function test_custom_homepage_cannot_be_deleted_from_parent_deletion()
{
- /** @var Page $page */
- $page = Page::query()->first();
+ $page = $this->entities->page();
$this->setSettings([
'app-homepage' => $page->id,
'app-homepage-type' => 'page',
public function test_custom_homepage_renders_includes()
{
$this->asEditor();
- /** @var Page $included */
- $included = Page::query()->first();
+ $included = $this->entities->page();
$content = str_repeat('This is the body content of my custom homepage.', 20);
$included->html = $content;
$included->save();
{
$editor = $this->getEditor();
setting()->putUser($editor, 'bookshelves_view_type', 'grid');
- $shelf = Bookshelf::query()->firstOrFail();
+ $shelf = $this->entities->shelf();
$this->setSettings(['app-homepage-type' => 'bookshelves']);
$this->setSettings(['app-homepage-type' => 'bookshelves']);
$this->asEditor();
- $shelf = Bookshelf::query()->first();
+ $shelf = $this->entities->shelf();
$book = $shelf->books()->first();
// Ensure initially visible