]> BookStack Code Mirror - bookstack/blobdiff - tests/TestCase.php
Added "page_include_parse" theme event
[bookstack] / tests / TestCase.php
index 92ae33a4ebeeef1729ea4934cb8d5e9882788aeb..f17d27a1aa320fe4ae4e0bc50ade126ae326302f 100644 (file)
@@ -89,6 +89,14 @@ abstract class TestCase extends BaseTestCase
         return $this->editor;
     }
 
+    /**
+     * Set the current user context to be a viewer.
+     */
+    public function asViewer()
+    {
+        return $this->actingAs($this->getViewer());
+    }
+
     /**
      * Get an instance of a user with 'viewer' permissions.
      */
@@ -430,7 +438,7 @@ abstract class TestCase extends BaseTestCase
     }
 
     /**
-     * @return Entity[]
+     * @return array{page: Page, chapter: Chapter, book: Book, bookshelf: Bookshelf}
      */
     protected function getEachEntityType(): array
     {