]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/EntityAccessTest.php
Added control-upon-access of the default favicon.ico file
[bookstack] / tests / Entity / EntityAccessTest.php
index f2f244538f474e97b6458bd6cb2e041657f1dc66..ab7587a3b273e3bdd06c7f0e4e4567fa6c9cddc5 100644 (file)
@@ -4,7 +4,6 @@ namespace Tests\Entity;
 
 use BookStack\Auth\UserRepo;
 use BookStack\Entities\Models\Entity;
-use BookStack\Entities\Repos\PageRepo;
 use Tests\TestCase;
 
 class EntityAccessTest extends TestCase
@@ -12,11 +11,11 @@ class EntityAccessTest extends TestCase
     public function test_entities_viewable_after_creator_deletion()
     {
         // Create required assets and revisions
-        $creator = $this->getEditor();
-        $updater = $this->getViewer();
-        $entities = $this->createEntityChainBelongingToUser($creator, $updater);
+        $creator = $this->users->editor();
+        $updater = $this->users->viewer();
+        $entities = $this->entities->createChainBelongingToUser($creator, $updater);
         app()->make(UserRepo::class)->destroy($creator);
-        app()->make(PageRepo::class)->update($entities['page'], ['html' => '<p>hello!</p>>']);
+        $this->entities->updatePage($entities['page'], ['html' => '<p>hello!</p>>']);
 
         $this->checkEntitiesViewable($entities);
     }
@@ -24,11 +23,11 @@ class EntityAccessTest extends TestCase
     public function test_entities_viewable_after_updater_deletion()
     {
         // Create required assets and revisions
-        $creator = $this->getViewer();
-        $updater = $this->getEditor();
-        $entities = $this->createEntityChainBelongingToUser($creator, $updater);
+        $creator = $this->users->viewer();
+        $updater = $this->users->editor();
+        $entities = $this->entities->createChainBelongingToUser($creator, $updater);
         app()->make(UserRepo::class)->destroy($updater);
-        app()->make(PageRepo::class)->update($entities['page'], ['html' => '<p>Hello there!</p>']);
+        $this->entities->updatePage($entities['page'], ['html' => '<p>Hello there!</p>']);
 
         $this->checkEntitiesViewable($entities);
     }