]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/TagTest.php
Merge branch 'master' of git://github.com/Binternet/BookStack into Binternet-master
[bookstack] / tests / Entity / TagTest.php
index 7e11663882533e120dbcd1138bb47a9b735dceab..13876410a0cddccaf4e3d04783e5735ccfd78697 100644 (file)
@@ -1,10 +1,11 @@
 <?php namespace Tests;
 
-use BookStack\Book;
-use BookStack\Chapter;
-use BookStack\Tag;
-use BookStack\Page;
-use BookStack\Services\PermissionService;
+use BookStack\Entities\Book;
+use BookStack\Entities\Chapter;
+use BookStack\Actions\Tag;
+use BookStack\Entities\Entity;
+use BookStack\Entities\Page;
+use BookStack\Auth\Permissions\PermissionService;
 
 class TagTest extends BrowserKitTest
 {
@@ -13,10 +14,10 @@ class TagTest extends BrowserKitTest
 
     /**
      * Get an instance of a page that has many tags.
-     * @param Tag[]|bool $tags
-     * @return mixed
+     * @param \BookStack\Actions\Tag[]|bool $tags
+     * @return Entity
      */
-    protected function getEntityWithTags($class, $tags = false)
+    protected function getEntityWithTags($class, $tags = false): Entity
     {
         $entity = $class::first();
 
@@ -122,7 +123,7 @@ class TagTest extends BrowserKitTest
         // Set restricted permission the page
         $page->restricted = true;
         $page->save();
-        $permissionService->buildJointPermissionsForEntity($page);
+        $page->rebuildPermissions();
 
         $this->asAdmin()->get('/ajax/tags/suggest/names?search=co')->seeJsonEquals(['color', 'country']);
         $this->asEditor()->get('/ajax/tags/suggest/names?search=co')->seeJsonEquals([]);