diff --git a/tests/codeception/api/_pages/AccountsRoute.php b/tests/codeception/api/_pages/AccountsRoute.php index 2f1bc05..7b4938b 100644 --- a/tests/codeception/api/_pages/AccountsRoute.php +++ b/tests/codeception/api/_pages/AccountsRoute.php @@ -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) { diff --git a/tests/codeception/api/functional/AccountsChangeEmailInitializeCest.php b/tests/codeception/api/functional/AccountsChangeEmailInitializeCest.php index 341086e..4feb158 100644 --- a/tests/codeception/api/functional/AccountsChangeEmailInitializeCest.php +++ b/tests/codeception/api/functional/AccountsChangeEmailInitializeCest.php @@ -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([ diff --git a/tests/codeception/api/unit/models/profile/ChangeEmail/InitStateFormTest.php b/tests/codeception/api/unit/models/profile/ChangeEmail/InitStateFormTest.php index 54e0598..1a9cdac 100644 --- a/tests/codeception/api/unit/models/profile/ChangeEmail/InitStateFormTest.php +++ b/tests/codeception/api/unit/models/profile/ChangeEmail/InitStateFormTest.php @@ -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,