2016-05-12 03:43:19 +05:30
|
|
|
<?php
|
2019-02-21 01:28:52 +05:30
|
|
|
namespace api\tests\functional;
|
2016-05-12 03:43:19 +05:30
|
|
|
|
2019-02-21 01:28:52 +05:30
|
|
|
use api\tests\_pages\AccountsRoute;
|
|
|
|
use api\tests\_pages\AuthenticationRoute;
|
|
|
|
use api\tests\FunctionalTester;
|
2016-05-12 03:43:19 +05:30
|
|
|
|
|
|
|
class RecoverPasswordCest {
|
|
|
|
|
|
|
|
public function testDataForFrequencyError(FunctionalTester $I) {
|
|
|
|
$authRoute = new AuthenticationRoute($I);
|
|
|
|
|
|
|
|
$I->wantTo('change my account password, using key from email');
|
|
|
|
$authRoute->recoverPassword('H24HBDCHHAG2HGHGHS', '12345678', '12345678');
|
|
|
|
$I->canSeeResponseContainsJson([
|
|
|
|
'success' => true,
|
|
|
|
]);
|
2016-05-30 05:14:17 +05:30
|
|
|
$I->canSeeAuthCredentials(false);
|
2016-05-12 03:43:19 +05:30
|
|
|
|
|
|
|
$I->wantTo('ensure, that jwt token is valid');
|
2016-05-30 05:14:17 +05:30
|
|
|
$jwt = $I->grabDataFromResponseByJsonPath('$.access_token')[0];
|
2016-05-12 03:43:19 +05:30
|
|
|
$I->amBearerAuthenticated($jwt);
|
|
|
|
$accountRoute = new AccountsRoute($I);
|
2017-09-19 22:36:16 +05:30
|
|
|
$accountRoute->get(5);
|
2016-05-12 03:43:19 +05:30
|
|
|
$I->canSeeResponseCodeIs(200);
|
|
|
|
$I->canSeeResponseIsJson();
|
|
|
|
$I->notLoggedIn();
|
|
|
|
|
|
|
|
$I->wantTo('check, that password is really changed');
|
|
|
|
$authRoute->login('Notch', '12345678');
|
|
|
|
$I->canSeeResponseContainsJson([
|
|
|
|
'success' => true,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|