mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-23 11:22:33 +01:00
Applied latest styleci changes
This commit is contained in:
parent
033b163675
commit
9d15688a43
@ -101,6 +101,7 @@ class CreateAdmin extends Command
|
||||
foreach ($this->options() as $key => $value) {
|
||||
$returnOpts[str_replace('-', '_', $key)] = $value;
|
||||
}
|
||||
|
||||
return $returnOpts;
|
||||
}
|
||||
}
|
||||
|
@ -77,8 +77,8 @@ class UserController extends Controller
|
||||
{
|
||||
$this->checkPermission('users-manage');
|
||||
$validationRules = [
|
||||
'name' => ['required'],
|
||||
'email' => ['required', 'email', 'unique:users,email'],
|
||||
'name' => ['required'],
|
||||
'email' => ['required', 'email', 'unique:users,email'],
|
||||
'setting' => ['array'],
|
||||
];
|
||||
|
||||
|
@ -21,8 +21,8 @@ class UserInviteTest extends TestCase
|
||||
|
||||
$email = Str::random(16) . '@example.com';
|
||||
$resp = $this->actingAs($admin)->post('/settings/users/create', [
|
||||
'name' => 'Barry',
|
||||
'email' => $email,
|
||||
'name' => 'Barry',
|
||||
'email' => $email,
|
||||
'send_invite' => 'true',
|
||||
]);
|
||||
$resp->assertRedirect('/settings/users');
|
||||
@ -42,12 +42,12 @@ class UserInviteTest extends TestCase
|
||||
|
||||
$email = Str::random(16) . '@example.com';
|
||||
$resp = $this->actingAs($admin)->post('/settings/users/create', [
|
||||
'name' => 'Barry',
|
||||
'email' => $email,
|
||||
'name' => 'Barry',
|
||||
'email' => $email,
|
||||
'send_invite' => 'true',
|
||||
'setting' => [
|
||||
'setting' => [
|
||||
'language' => 'de',
|
||||
]
|
||||
],
|
||||
]);
|
||||
$resp->assertRedirect('/settings/users');
|
||||
|
||||
@ -55,6 +55,7 @@ class UserInviteTest extends TestCase
|
||||
Notification::assertSentTo($newUser, UserInvite::class, function ($notification, $channels, $notifiable) {
|
||||
/** @var MailMessage $mail */
|
||||
$mail = $notification->toMail($notifiable);
|
||||
|
||||
return 'Du wurdest eingeladen BookStack beizutreten!' === $mail->subject &&
|
||||
'Ein Konto wurde für Sie auf BookStack erstellt.' === $mail->greeting;
|
||||
});
|
||||
@ -80,7 +81,7 @@ class UserInviteTest extends TestCase
|
||||
]);
|
||||
$setPasswordResp->assertSee('Password set, you should now be able to login using your set password to access BookStack!');
|
||||
$newPasswordValid = auth()->validate([
|
||||
'email' => $user->email,
|
||||
'email' => $user->email,
|
||||
'password' => 'my test password',
|
||||
]);
|
||||
$this->assertTrue($newPasswordValid);
|
||||
|
@ -11,14 +11,14 @@ class CreateAdminCommandTest extends TestCase
|
||||
public function test_standard_command_usage()
|
||||
{
|
||||
$this->artisan('bookstack:create-admin', [
|
||||
'--email' => 'admintest@example.com',
|
||||
'--name' => 'Admin Test',
|
||||
'--email' => 'admintest@example.com',
|
||||
'--name' => 'Admin Test',
|
||||
'--password' => 'testing-4',
|
||||
])->assertExitCode(0);
|
||||
|
||||
$this->assertDatabaseHas('users', [
|
||||
'email' => 'admintest@example.com',
|
||||
'name' => 'Admin Test',
|
||||
'name' => 'Admin Test',
|
||||
]);
|
||||
|
||||
/** @var User $user */
|
||||
@ -30,14 +30,14 @@ class CreateAdminCommandTest extends TestCase
|
||||
public function test_providing_external_auth_id()
|
||||
{
|
||||
$this->artisan('bookstack:create-admin', [
|
||||
'--email' => 'admintest@example.com',
|
||||
'--name' => 'Admin Test',
|
||||
'--email' => 'admintest@example.com',
|
||||
'--name' => 'Admin Test',
|
||||
'--external-auth-id' => 'xX_admin_Xx',
|
||||
])->assertExitCode(0);
|
||||
|
||||
$this->assertDatabaseHas('users', [
|
||||
'email' => 'admintest@example.com',
|
||||
'name' => 'Admin Test',
|
||||
'email' => 'admintest@example.com',
|
||||
'name' => 'Admin Test',
|
||||
'external_auth_id' => 'xX_admin_Xx',
|
||||
]);
|
||||
|
||||
@ -50,13 +50,13 @@ class CreateAdminCommandTest extends TestCase
|
||||
{
|
||||
$this->artisan('bookstack:create-admin', [
|
||||
'--email' => 'admintest@example.com',
|
||||
'--name' => 'Admin Test',
|
||||
'--name' => 'Admin Test',
|
||||
])->expectsQuestion('Please specify a password for the new admin user (8 characters min)', 'hunter2000')
|
||||
->assertExitCode(0);
|
||||
|
||||
$this->assertDatabaseHas('users', [
|
||||
'email' => 'admintest@example.com',
|
||||
'name' => 'Admin Test',
|
||||
'name' => 'Admin Test',
|
||||
]);
|
||||
$this->assertTrue(Auth::attempt(['email' => 'admintest@example.com', 'password' => 'hunter2000']));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user