1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2026-01-03 23:42:28 +03:00

Extracted entity testcase methods to own class

Also added some new fetch helper methods for future use.
This commit is contained in:
Dan Brown
2022-09-29 16:49:25 +01:00
parent 0e94fd44a8
commit 068a8a068c
23 changed files with 305 additions and 208 deletions

View File

@@ -57,7 +57,7 @@ class ReferencesTest extends TestCase
public function test_references_to_count_visible_on_entity_show_view()
{
$entities = $this->getEachEntityType();
$entities = $this->entities->all();
/** @var Page $otherPage */
$otherPage = Page::query()->where('id', '!=', $entities['page']->id)->first();
@@ -79,7 +79,7 @@ class ReferencesTest extends TestCase
public function test_references_to_visible_on_references_page()
{
$entities = $this->getEachEntityType();
$entities = $this->entities->all();
$this->asEditor();
foreach ($entities as $entity) {
$this->createReference($entities['page'], $entity);
@@ -101,7 +101,7 @@ class ReferencesTest extends TestCase
$pageB = Page::query()->where('id', '!=', $page->id)->first();
$this->createReference($pageB, $page);
$this->setEntityRestrictions($pageB);
$this->entities->setPermissions($pageB);
$this->asEditor()->get($page->getUrl('/references'))->assertDontSee($pageB->name);
$this->asAdmin()->get($page->getUrl('/references'))->assertSee($pageB->name);