|
|
|
@ -447,7 +447,7 @@ class LostControllerTest extends TestCase {
|
|
|
|
|
|
|
|
|
|
$response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', true);
|
|
|
|
|
$expectedResponse = ['status' => 'error', 'msg' => ''];
|
|
|
|
|
$this->assertSame($expectedResponse, $response);
|
|
|
|
|
$this->assertSame($expectedResponse, $response->getData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSetPasswordSuccessful() {
|
|
|
|
@ -475,7 +475,7 @@ class LostControllerTest extends TestCase {
|
|
|
|
|
|
|
|
|
|
$response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', true);
|
|
|
|
|
$expectedResponse = ['user' => 'ValidTokenUser', 'status' => 'success'];
|
|
|
|
|
$this->assertSame($expectedResponse, $response);
|
|
|
|
|
$this->assertSame($expectedResponse, $response->getData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSetPasswordExpiredToken() {
|
|
|
|
@ -494,7 +494,7 @@ class LostControllerTest extends TestCase {
|
|
|
|
|
'status' => 'error',
|
|
|
|
|
'msg' => 'Could not reset password because the token is expired',
|
|
|
|
|
];
|
|
|
|
|
$this->assertSame($expectedResponse, $response);
|
|
|
|
|
$this->assertSame($expectedResponse, $response->getData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSetPasswordInvalidDataInDb() {
|
|
|
|
@ -514,7 +514,7 @@ class LostControllerTest extends TestCase {
|
|
|
|
|
'status' => 'error',
|
|
|
|
|
'msg' => 'Could not reset password because the token is invalid',
|
|
|
|
|
];
|
|
|
|
|
$this->assertSame($expectedResponse, $response);
|
|
|
|
|
$this->assertSame($expectedResponse, $response->getData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testIsSetPasswordWithoutTokenFailing() {
|
|
|
|
@ -533,7 +533,7 @@ class LostControllerTest extends TestCase {
|
|
|
|
|
'status' => 'error',
|
|
|
|
|
'msg' => 'Could not reset password because the token is invalid'
|
|
|
|
|
];
|
|
|
|
|
$this->assertSame($expectedResponse, $response);
|
|
|
|
|
$this->assertSame($expectedResponse, $response->getData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSetPasswordForDisabledUser() {
|
|
|
|
@ -563,7 +563,7 @@ class LostControllerTest extends TestCase {
|
|
|
|
|
'status' => 'error',
|
|
|
|
|
'msg' => 'Could not reset password because the token is invalid'
|
|
|
|
|
];
|
|
|
|
|
$this->assertSame($expectedResponse, $response);
|
|
|
|
|
$this->assertSame($expectedResponse, $response->getData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSendEmailNoEmail() {
|
|
|
|
@ -599,7 +599,7 @@ class LostControllerTest extends TestCase {
|
|
|
|
|
}]]);
|
|
|
|
|
$response = $this->lostController->setPassword('myToken', 'user', 'newpass', false);
|
|
|
|
|
$expectedResponse = ['status' => 'error', 'msg' => '', 'encryption' => true];
|
|
|
|
|
$this->assertSame($expectedResponse, $response);
|
|
|
|
|
$this->assertSame($expectedResponse, $response->getData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSetPasswordDontProceedMasterKey() {
|
|
|
|
@ -627,7 +627,7 @@ class LostControllerTest extends TestCase {
|
|
|
|
|
|
|
|
|
|
$response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', false);
|
|
|
|
|
$expectedResponse = ['user' => 'ValidTokenUser', 'status' => 'success'];
|
|
|
|
|
$this->assertSame($expectedResponse, $response);
|
|
|
|
|
$this->assertSame($expectedResponse, $response->getData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testTwoUsersWithSameEmail() {
|
|
|
|
|