Skip to content

Commit 158dd5e

Browse files
author
Andres Campanario
committed
fix tests
1 parent 5c1f636 commit 158dd5e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/TestCase/Controller/Traits/Integration/PasswordManagementTraitIntegrationTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testRequestResetPasswordPostValidEmail()
6161
];
6262
$this->post('/users/request-reset-password', $data);
6363
$this->assertRedirect('/login');
64-
$this->assertFlashMessage('Please check your email to continue with password reset process');
64+
$this->assertFlashMessage('If the account is valid, the system will send an instructional email to the address on record.');
6565
$userAfter = $Table->find()->where(['email' => '[email protected]'])->firstOrFail();
6666
$this->assertNotEquals('token-4', $userAfter->token);
6767
$this->assertNotEmpty($userAfter->token);
@@ -107,6 +107,6 @@ public function testRequestResetPasswordPostInvalidEmail()
107107
];
108108
$this->post('/users/request-reset-password', $data);
109109
$this->assertResponseOk();
110-
$this->assertFlashMessage('User [email protected] was not found');
110+
$this->assertFlashMessage('If the account is valid, the system will send an instructional email to the address on record.');
111111
}
112112
}

tests/TestCase/Controller/Traits/PasswordManagementTraitTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ public function testRequestPasswordEmptyReference()
401401
->will($this->returnValue($reference));
402402
$this->Trait->Flash->expects($this->any())
403403
->method('error')
404-
->with('Token could not be reset');
404+
->with('There was an error please contact Administrator');
405405

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

0 commit comments

Comments
 (0)