]> BookStack Code Mirror - bookstack/blobdiff - tests/Api/RecycleBinApiTest.php
Opensearch: Fixed XML declaration when php short tags enabled
[bookstack] / tests / Api / RecycleBinApiTest.php
index bc7249987dd0da3e01a9d7ee777d336ffb8b98af..d174838c27d0db38d5346cae9478ba1c0b3d09bd 100644 (file)
@@ -21,8 +21,8 @@ class RecycleBinApiTest extends TestCase
 
     public function test_settings_manage_permission_needed_for_all_endpoints()
     {
-        $editor = $this->getEditor();
-        $this->giveUserPermissions($editor, ['settings-manage']);
+        $editor = $this->users->editor();
+        $this->permissions->grantUserRolePermissions($editor, ['settings-manage']);
         $this->actingAs($editor);
 
         foreach ($this->endpointMap as [$method, $uri]) {
@@ -34,8 +34,8 @@ class RecycleBinApiTest extends TestCase
 
     public function test_restrictions_manage_all_permission_needed_for_all_endpoints()
     {
-        $editor = $this->getEditor();
-        $this->giveUserPermissions($editor, ['restrictions-manage-all']);
+        $editor = $this->users->editor();
+        $this->permissions->grantUserRolePermissions($editor, ['restrictions-manage-all']);
         $this->actingAs($editor);
 
         foreach ($this->endpointMap as [$method, $uri]) {
@@ -47,7 +47,7 @@ class RecycleBinApiTest extends TestCase
 
     public function test_index_endpoint_returns_expected_page()
     {
-        $admin = $this->getAdmin();
+        $admin = $this->users->admin();
 
         $page = $this->entities->page();
         $book = $this->entities->book();
@@ -82,7 +82,7 @@ class RecycleBinApiTest extends TestCase
 
     public function test_index_endpoint_returns_children_count()
     {
-        $admin = $this->getAdmin();
+        $admin = $this->users->admin();
 
         $book = Book::query()->whereHas('pages')->whereHas('chapters')->withCount(['pages', 'chapters'])->first();
         $this->actingAs($admin)->delete($book->getUrl());
@@ -109,7 +109,7 @@ class RecycleBinApiTest extends TestCase
 
     public function test_index_endpoint_returns_parent()
     {
-        $admin = $this->getAdmin();
+        $admin = $this->users->admin();
         $page = $this->entities->pageWithinChapter();
 
         $this->actingAs($admin)->delete($page->getUrl());