Cleanup
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
50a5d6216b
commit
667fc4b731
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
namespace App;
|
namespace App;
|
||||||
|
|
||||||
use App\Auth\ResetPassword;
|
|
||||||
use Database\Factories\UserFactory;
|
use Database\Factories\UserFactory;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
|
use Modules\Auth\Mails\ResetPassword;
|
||||||
|
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,13 +2,10 @@
|
||||||
|
|
||||||
namespace Modules\Auth\Components;
|
namespace Modules\Auth\Components;
|
||||||
|
|
||||||
use App\Auth\ResetPassword;
|
use Modules\Auth\Mails\ResetPassword;
|
||||||
use App\User;
|
use App\User;
|
||||||
use Illuminate\Auth\Events\Lockout;
|
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
use Illuminate\Support\Facades\Event;
|
|
||||||
use Illuminate\Support\Facades\Mail;
|
|
||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
use Livewire\Livewire;
|
use Livewire\Livewire;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Auth;
|
namespace Modules\Auth\Mails;
|
||||||
|
|
||||||
use Illuminate\Notifications\Messages\MailMessage;
|
use Illuminate\Notifications\Messages\MailMessage;
|
||||||
use Illuminate\Support\Facades\Lang;
|
use Illuminate\Support\Facades\Lang;
|
||||||
|
@ -17,7 +17,7 @@ class ResetPassword extends BaseResetPassword
|
||||||
protected function buildMailMessage($url)
|
protected function buildMailMessage($url)
|
||||||
{
|
{
|
||||||
return (new MailMessage)
|
return (new MailMessage)
|
||||||
->subject(Lang::get('Passwort zurücksetzen | Adrema'))
|
->subject(Lang::get('Passwort zurücksetzen | ' . config('app.name')))
|
||||||
->line(Lang::get('Du erhälst diese E-Mail, weil du eine Anfrage zum zurücksetzen deines Account-Passworts gestellt hast.'))
|
->line(Lang::get('Du erhälst diese E-Mail, weil du eine Anfrage zum zurücksetzen deines Account-Passworts gestellt hast.'))
|
||||||
->action(Lang::get('Passwort zurücksetzen'), $url)
|
->action(Lang::get('Passwort zurücksetzen'), $url)
|
||||||
->line(Lang::get('Dieser Link wird in :count Minuten ablaufen.', ['count' => config('auth.passwords.' . config('auth.defaults.passwords') . '.expire')]))
|
->line(Lang::get('Dieser Link wird in :count Minuten ablaufen.', ['count' => config('auth.passwords.' . config('auth.defaults.passwords') . '.expire')]))
|
|
@ -1,44 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\Feature\Authentication;
|
|
||||||
|
|
||||||
use App\Auth\ResetPassword;
|
|
||||||
use App\User;
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
||||||
use Illuminate\Support\Facades\Notification;
|
|
||||||
use Tests\TestCase;
|
|
||||||
|
|
||||||
class ForgotPasswordTest extends TestCase
|
|
||||||
{
|
|
||||||
use DatabaseTransactions;
|
|
||||||
|
|
||||||
public function testItShowsResetForm(): void
|
|
||||||
{
|
|
||||||
$this->withoutExceptionHandling();
|
|
||||||
$this->get('/password/reset')->assertComponent('authentication/PasswordReset');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testItRequiresAnEmailAddress(): void
|
|
||||||
{
|
|
||||||
$this->postJson('/password/email')->assertJsonValidationErrors(['email' => 'E-Mail Adresse ist erforderlich.']);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testItNeedsAnActiveUser(): void
|
|
||||||
{
|
|
||||||
$this->postJson('/password/email', [
|
|
||||||
'email' => 'test@aa.de',
|
|
||||||
])->assertJsonValidationErrors(['email' => 'Es konnte leider kein Nutzer mit dieser E-Mail-Adresse gefunden werden.']);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testItSendsPasswordResetLink(): void
|
|
||||||
{
|
|
||||||
Notification::fake();
|
|
||||||
|
|
||||||
$user = User::factory()->create(['email' => 'test@aa.de']);
|
|
||||||
$this->postJson('/password/email', [
|
|
||||||
'email' => 'test@aa.de',
|
|
||||||
])->assertOk();
|
|
||||||
|
|
||||||
Notification::assertSentTo($user, ResetPassword::class);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue