3 changed files with 31 additions and 64 deletions
-
4routes/web/account.php
-
62tests/auth/MemberResetPasswordTest.php
-
29tests/auth/ResetPasswordTest.php
@ -1,62 +0,0 @@ |
|||||
<?php |
|
||||
|
|
||||
use App\Entities\Users\User; |
|
||||
|
|
||||
class MemberResetPasswordTest extends TestCase |
|
||||
{ |
|
||||
/** @test */ |
|
||||
public function member_can_reset_password_by_their_email() |
|
||||
{ |
|
||||
// $user = factory(User::class)->create();
|
|
||||
|
|
||||
// // Reset Request
|
|
||||
// $this->visit(route('auth.reset-request'));
|
|
||||
// $this->notSeeInDatabase('password_resets', [
|
|
||||
// 'email' => $user->email
|
|
||||
// ]);
|
|
||||
// $this->see('Reset Password');
|
|
||||
// $this->type($user->email,'email');
|
|
||||
// $this->press('Kirim Link Reset Password');
|
|
||||
// $this->seePageIs(route('auth.reset-request'));
|
|
||||
// $this->see('Kami sudah mengirim email');
|
|
||||
// $this->seeInDatabase('password_resets', [
|
|
||||
// 'email' => $user->email
|
|
||||
// ]);
|
|
||||
|
|
||||
// // Reset Action
|
|
||||
// $resetData = DB::table('password_resets')->where('email', $user->email)->first();
|
|
||||
// $token = $resetData->token;
|
|
||||
|
|
||||
// $this->visit('password/reset/' . $token);
|
|
||||
// $this->see('Reset Password');
|
|
||||
// $this->see('Password Baru');
|
|
||||
|
|
||||
// // Enter an invalid email
|
|
||||
// $this->type('mail@mail.com','email');
|
|
||||
// $this->type('rahasia','password');
|
|
||||
// $this->type('rahasia','password_confirmation');
|
|
||||
// $this->press('Reset Password');
|
|
||||
// $this->see('Kami tidak dapat menemukan pengguna dengan email tersebut');
|
|
||||
|
|
||||
// // Enter a valid email
|
|
||||
// $this->type($user->email,'email');
|
|
||||
// $this->type('rahasia','password');
|
|
||||
// $this->type('rahasia','password_confirmation');
|
|
||||
// $this->press('Reset Password');
|
|
||||
|
|
||||
// $this->seePageIs(route('home'));
|
|
||||
|
|
||||
// $this->notSeeInDatabase('password_resets', [
|
|
||||
// 'email' => $user->email
|
|
||||
// ]);
|
|
||||
|
|
||||
// // Logout and login using new Password
|
|
||||
// $this->click('Keluar');
|
|
||||
// $this->seePageIs(route('auth.login'));
|
|
||||
// $this->type($user->username,'username');
|
|
||||
// $this->type('rahasia','password');
|
|
||||
// $this->press('Login');
|
|
||||
// $this->seePageIs(route('home'));
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
@ -0,0 +1,29 @@ |
|||||
|
<?php |
||||
|
|
||||
|
use App\Entities\Users\User; |
||||
|
|
||||
|
class ResetPasswordTest extends TestCase |
||||
|
{ |
||||
|
/** @test */ |
||||
|
public function user_can_reset_password_by_their_email() |
||||
|
{ |
||||
|
// $user = factory(User::class)->create();
|
||||
|
$user1 = factory(User::class)->create(['username' => '123456', 'email' => 'testing@app.dev']); |
||||
|
|
||||
|
// Reset Request
|
||||
|
$this->visit('password/reset'); |
||||
|
$this->notSeeInDatabase('password_resets', [ |
||||
|
'email' => 'testing@app.dev' |
||||
|
]); |
||||
|
$this->see(trans('auth.reset_password')); |
||||
|
$this->type('testing@app.dev','email'); |
||||
|
$this->press(trans('auth.send_reset_password_link')); |
||||
|
$this->seePageIs('password/reset'); |
||||
|
$this->see(trans('passwords.sent')); |
||||
|
$this->seeInDatabase('password_resets', [ |
||||
|
'email' => 'testing@app.dev' |
||||
|
]); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue