1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Copied over work from user_permissions branch

Only that relevant to the additional testing work.
This commit is contained in:
Dan Brown
2023-01-21 11:08:34 +00:00
parent 6070d804f8
commit c724bfe4d3
72 changed files with 1566 additions and 545 deletions

View 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);