From 3d6d9d484c518a80d783977268918003f3601460 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Mon, 23 May 2016 21:27:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D1=82=D0=B5=D1=81=D1=82=D1=8B=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B=20=D0=B8=D0=BD?= =?UTF-8?q?=D0=B8=D1=86=D0=B8=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8=20=D1=81=D0=BC=D0=B5=D0=BD=D1=8B=20E-mail=20=D0=B0=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/codeception/api/_pages/AccountsRoute.php | 6 ++++-- .../api/functional/AccountsChangeEmailInitializeCest.php | 4 ++-- .../unit/models/profile/ChangeEmail/InitStateFormTest.php | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) 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,