Example #1
0
 public function _before(\FunctionalTester $I)
 {
     // First submit a reset request.
     RequestPasswordResetPage::openBy($I);
     RequestPasswordResetPage::submitEmail($I, Auth::$validEmail);
     // Get the reset token.
     $token = $I->grabRecord('app\\models\\User', ['email' => Auth::$validEmail])->passwordResetToken;
     // Open the password reset page.
     ResetPasswordPage::openBy($I, ['token' => $token]);
 }
 public function testValidEmail(\FunctionalTester $I)
 {
     $I->wantTo('test that submitting a valid email succeeds');
     RequestPasswordResetPage::openBy($I);
     $I->cleanDir($I->getEmailDir());
     RequestPasswordResetPage::submitEmail($I, Auth::$validEmail);
     $I->see(RequestPasswordResetPage::$successText);
     $I->seeFileFound('*.eml', $I->getEmailDir());
     $I->openFile($I->getFirstEmailPath());
     $I->seeInThisFile(Email::$resetSubject);
     $I->seeInThisFile(Email::$resetText);
     $I->seeInThisFile(Email::$resetLink);
     $user = $I->grabRecord('app\\models\\User', ['email' => Auth::$validEmail]);
     $I->assertNotEmpty($user->passwordResetToken);
 }