mirror of
https://github.com/elyby/accounts.git
synced 2024-11-30 10:42:16 +05:30
Исправлены тесты для формы инициализации смены E-mail адреса
This commit is contained in:
parent
1b4249ecd7
commit
3d6d9d484c
@ -30,9 +30,11 @@ class AccountsRoute extends BasePage {
|
||||
]);
|
||||
}
|
||||
|
||||
public function changeEmailInitialize() {
|
||||
public function changeEmailInitialize($password = '') {
|
||||
$this->route = ['accounts/change-email-initialize'];
|
||||
$this->actor->sendPOST($this->getUrl());
|
||||
$this->actor->sendPOST($this->getUrl(), [
|
||||
'password' => $password,
|
||||
]);
|
||||
}
|
||||
|
||||
public function changeEmailSubmitNewEmail($key = null, $email = null) {
|
||||
|
@ -20,7 +20,7 @@ class AccountsChangeEmailInitializeCest {
|
||||
$I->wantTo('send current email confirmation');
|
||||
$I->loggedInAsActiveAccount();
|
||||
|
||||
$this->route->changeEmailInitialize();
|
||||
$this->route->changeEmailInitialize('password_0');
|
||||
$I->canSeeResponseCodeIs(200);
|
||||
$I->canSeeResponseIsJson();
|
||||
$I->canSeeResponseContainsJson([
|
||||
@ -32,7 +32,7 @@ class AccountsChangeEmailInitializeCest {
|
||||
$I->wantTo('see, that account use old account password hash strategy');
|
||||
$I->loggedInAsActiveAccount('AccWithOldPassword', '12345678');
|
||||
|
||||
$this->route->changeEmailInitialize();
|
||||
$this->route->changeEmailInitialize('password_0');
|
||||
$I->canSeeResponseCodeIs(200);
|
||||
$I->canSeeResponseIsJson();
|
||||
$I->canSeeResponseContainsJson([
|
||||
|
@ -79,7 +79,9 @@ class InitStateFormTest extends DbTestCase {
|
||||
$this->specify('send email', function() {
|
||||
/** @var Account $account */
|
||||
$account = Account::findOne($this->accounts['admin']['id']);
|
||||
$model = new InitStateForm($account);
|
||||
$model = new InitStateForm($account, [
|
||||
'password' => 'password_0',
|
||||
]);
|
||||
expect($model->sendCurrentEmailConfirmation())->true();
|
||||
expect(EmailActivation::find()->andWhere([
|
||||
'account_id' => $account->id,
|
||||
|
Loading…
Reference in New Issue
Block a user