Skip to content

Commit

Permalink
Code style
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbyoung committed Aug 10, 2023
1 parent 599a052 commit c6fb36b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/Integration/CreatesUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ private function createUser(bool $createAsAdmin = false, string $password = 'pas
// Create a unique email address so we do not have collisions
$roles = \is_string($roles) ? [$roles] : $roles;
$newUser = new NewUser(\bin2hex(\random_bytes(8)) . '@example.com', $password, $roles);
$principalBuilder = (new PrincipalBuilder('example.com'))->withNameIdentifier(0);
$actingAs = $createAsAdmin
? (new PrincipalBuilder('example.com'))->withRoles('admin')
? $principalBuilder->withRoles('admin')
->build()
: (new PrincipalBuilder('example.com'))->build();
: $principalBuilder->build();
$createUserResponse = $this->actingAs($actingAs, fn () => $this->post('/users', body: $newUser));

if ($createUserResponse->getStatusCode() !== HttpStatusCode::Ok) {
Expand Down

0 comments on commit c6fb36b

Please sign in to comment.