]> BookStack Code Mirror - bookstack/blobdiff - tests/Api/UsersApiTest.php
Added method for using enity ownership in relation queries
[bookstack] / tests / Api / UsersApiTest.php
index 739981f24b17d1cd883398715d4973fcc7395a1e..c89f9e6e30b83e26154f99174c59d86519393daa 100644 (file)
@@ -175,7 +175,7 @@ class UsersApiTest extends TestCase
     {
         $this->actingAsApiAdmin();
         /** @var User $user */
-        $user = $this->getAdmin();
+        $user = $this->users->admin();
         $roles = Role::query()->pluck('id');
         $resp = $this->putJson($this->baseEndpoint . "/{$user->id}", [
             'name'             => 'My updated user',
@@ -204,7 +204,7 @@ class UsersApiTest extends TestCase
     {
         $this->actingAsApiAdmin();
         /** @var User $user */
-        $user = $this->getAdmin();
+        $user = $this->users->admin();
         $roleCount = $user->roles()->count();
         $resp = $this->putJson($this->baseEndpoint . "/{$user->id}", []);
 
@@ -222,7 +222,7 @@ class UsersApiTest extends TestCase
     {
         $this->actingAsApiAdmin();
         /** @var User $user */
-        $user = User::query()->where('id', '!=', $this->getAdmin()->id)
+        $user = User::query()->where('id', '!=', $this->users->admin()->id)
             ->whereNull('system_name')
             ->first();
 
@@ -236,7 +236,7 @@ class UsersApiTest extends TestCase
     {
         $this->actingAsApiAdmin();
         /** @var User $user */
-        $user = User::query()->where('id', '!=', $this->getAdmin()->id)
+        $user = User::query()->where('id', '!=', $this->users->admin()->id)
             ->whereNull('system_name')
             ->first();
         $entityChain = $this->entities->createChainBelongingToUser($user);