Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres Campanario committed Mar 12, 2024
1 parent 5c1f636 commit 158dd5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testRequestResetPasswordPostValidEmail()
];
$this->post('/users/request-reset-password', $data);
$this->assertRedirect('/login');
$this->assertFlashMessage('Please check your email to continue with password reset process');
$this->assertFlashMessage('If the account is valid, the system will send an instructional email to the address on record.');
$userAfter = $Table->find()->where(['email' => '[email protected]'])->firstOrFail();
$this->assertNotEquals('token-4', $userAfter->token);
$this->assertNotEmpty($userAfter->token);
Expand Down Expand Up @@ -107,6 +107,6 @@ public function testRequestResetPasswordPostInvalidEmail()
];
$this->post('/users/request-reset-password', $data);
$this->assertResponseOk();
$this->assertFlashMessage('User [email protected] was not found');
$this->assertFlashMessage('If the account is valid, the system will send an instructional email to the address on record.');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public function testRequestPasswordEmptyReference()
->will($this->returnValue($reference));
$this->Trait->Flash->expects($this->any())
->method('error')
->with('Token could not be reset');
->with('There was an error please contact Administrator');

$this->Trait->expects($this->never())
->method('redirect');
Expand Down Expand Up @@ -431,8 +431,8 @@ public function testEnsureUserActiveForResetPasswordFeature($ensureActive)
->with('reference')
->will($this->returnValue($reference));
$this->Trait->Flash->expects($expectError)
->method('error')
->with('The user is not active');
->method('success')
->with('If the account is valid, the system will send an instructional email to the address on record.');
$this->Trait->requestResetPassword();
$this->assertNotEquals('xxx', $this->table->get('00000000-0000-0000-0000-000000000001')->token);
}
Expand Down

0 comments on commit 158dd5e

Please sign in to comment.