Skip to content

Commit 9d15688

Browse files
committed
Applied latest styleci changes
1 parent 033b163 commit 9d15688

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

app/Console/Commands/CreateAdmin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ protected function snakeCaseOptions(): array
101101
foreach ($this->options() as $key => $value) {
102102
$returnOpts[str_replace('-', '_', $key)] = $value;
103103
}
104+
104105
return $returnOpts;
105106
}
106107
}

app/Http/Controllers/UserController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ public function store(Request $request)
7777
{
7878
$this->checkPermission('users-manage');
7979
$validationRules = [
80-
'name' => ['required'],
81-
'email' => ['required', 'email', 'unique:users,email'],
80+
'name' => ['required'],
81+
'email' => ['required', 'email', 'unique:users,email'],
8282
'setting' => ['array'],
8383
];
8484

tests/Auth/UserInviteTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public function test_user_creation_creates_invite()
2121

2222
$email = Str::random(16) . '@example.com';
2323
$resp = $this->actingAs($admin)->post('/settings/users/create', [
24-
'name' => 'Barry',
25-
'email' => $email,
24+
'name' => 'Barry',
25+
'email' => $email,
2626
'send_invite' => 'true',
2727
]);
2828
$resp->assertRedirect('/settings/users');
@@ -42,19 +42,20 @@ public function test_user_invite_sent_in_selected_language()
4242

4343
$email = Str::random(16) . '@example.com';
4444
$resp = $this->actingAs($admin)->post('/settings/users/create', [
45-
'name' => 'Barry',
46-
'email' => $email,
45+
'name' => 'Barry',
46+
'email' => $email,
4747
'send_invite' => 'true',
48-
'setting' => [
48+
'setting' => [
4949
'language' => 'de',
50-
]
50+
],
5151
]);
5252
$resp->assertRedirect('/settings/users');
5353

5454
$newUser = User::query()->where('email', '=', $email)->orderBy('id', 'desc')->first();
5555
Notification::assertSentTo($newUser, UserInvite::class, function ($notification, $channels, $notifiable) {
5656
/** @var MailMessage $mail */
5757
$mail = $notification->toMail($notifiable);
58+
5859
return 'Du wurdest eingeladen BookStack beizutreten!' === $mail->subject &&
5960
'Ein Konto wurde für Sie auf BookStack erstellt.' === $mail->greeting;
6061
});
@@ -80,7 +81,7 @@ public function test_invite_set_password()
8081
]);
8182
$setPasswordResp->assertSee('Password set, you should now be able to login using your set password to access BookStack!');
8283
$newPasswordValid = auth()->validate([
83-
'email' => $user->email,
84+
'email' => $user->email,
8485
'password' => 'my test password',
8586
]);
8687
$this->assertTrue($newPasswordValid);

tests/Commands/CreateAdminCommandTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ class CreateAdminCommandTest extends TestCase
1111
public function test_standard_command_usage()
1212
{
1313
$this->artisan('bookstack:create-admin', [
14-
'--email' => '[email protected]',
15-
'--name' => 'Admin Test',
14+
'--email' => '[email protected]',
15+
'--name' => 'Admin Test',
1616
'--password' => 'testing-4',
1717
])->assertExitCode(0);
1818

1919
$this->assertDatabaseHas('users', [
2020
'email' => '[email protected]',
21-
'name' => 'Admin Test',
21+
'name' => 'Admin Test',
2222
]);
2323

2424
/** @var User $user */
@@ -30,14 +30,14 @@ public function test_standard_command_usage()
3030
public function test_providing_external_auth_id()
3131
{
3232
$this->artisan('bookstack:create-admin', [
33-
'--email' => '[email protected]',
34-
'--name' => 'Admin Test',
33+
'--email' => '[email protected]',
34+
'--name' => 'Admin Test',
3535
'--external-auth-id' => 'xX_admin_Xx',
3636
])->assertExitCode(0);
3737

3838
$this->assertDatabaseHas('users', [
39-
'email' => '[email protected]',
40-
'name' => 'Admin Test',
39+
'email' => '[email protected]',
40+
'name' => 'Admin Test',
4141
'external_auth_id' => 'xX_admin_Xx',
4242
]);
4343

@@ -50,13 +50,13 @@ public function test_password_required_if_external_auth_id_not_given()
5050
{
5151
$this->artisan('bookstack:create-admin', [
5252
'--email' => '[email protected]',
53-
'--name' => 'Admin Test',
53+
'--name' => 'Admin Test',
5454
])->expectsQuestion('Please specify a password for the new admin user (8 characters min)', 'hunter2000')
5555
->assertExitCode(0);
5656

5757
$this->assertDatabaseHas('users', [
5858
'email' => '[email protected]',
59-
'name' => 'Admin Test',
59+
'name' => 'Admin Test',
6060
]);
6161
$this->assertTrue(Auth::attempt(['email' => '[email protected]', 'password' => 'hunter2000']));
6262
}

0 commit comments

Comments
 (0)