From b5ed01853e1572b80c36ea7f72758ebf317d2928 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Mon, 23 May 2016 22:55:36 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=20=D0=B2=D0=B0?= =?UTF-8?q?=D0=BB=D0=B8=D0=B4=D0=B0=D1=82=D0=BE=D1=80=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=82=D0=B8=D0=BF=20=D0=B0=D0=BB=D0=B3=D0=BE=D1=80=D0=B8=D1=82?= =?UTF-8?q?=D0=BC=D0=B0=20=D1=85=D1=8D=D1=88=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=B0=D1=80=D0=BE=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B=20=D0=B8?= =?UTF-8?q?=D0=BD=D0=B8=D1=86=D0=B8=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8=20=D1=81=D0=BC=D0=B5=D0=BD=D1=8B=20E-mail=20=D0=B0?= =?UTF-8?q?=D0=B4=D1=80=D0=B5=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profile/ChangeEmail/InitStateForm.php | 12 +++--------- .../profile/ChangeEmail/InitStateFormTest.php | 18 ------------------ 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/api/models/profile/ChangeEmail/InitStateForm.php b/api/models/profile/ChangeEmail/InitStateForm.php index 169290d..dc96a30 100644 --- a/api/models/profile/ChangeEmail/InitStateForm.php +++ b/api/models/profile/ChangeEmail/InitStateForm.php @@ -1,6 +1,7 @@ false], - ]); - } - public function validateAccountPasswordHashStrategy($attribute) { - $account = $this->getAccount(); - if ($account->password_hash_strategy === Account::PASS_HASH_STRATEGY_OLD_ELY) { - $this->addError($attribute, 'error.old_hash_strategy'); - } + ]); } public function sendCurrentEmailConfirmation() { diff --git a/tests/codeception/api/unit/models/profile/ChangeEmail/InitStateFormTest.php b/tests/codeception/api/unit/models/profile/ChangeEmail/InitStateFormTest.php index 1a9cdac..8428bcf 100644 --- a/tests/codeception/api/unit/models/profile/ChangeEmail/InitStateFormTest.php +++ b/tests/codeception/api/unit/models/profile/ChangeEmail/InitStateFormTest.php @@ -45,24 +45,6 @@ class InitStateFormTest extends DbTestCase { ]; } - public function testValidateAccountPasswordHashStrategy() { - $this->specify('we cannot change password on old password hash strategy', function() { - $account = new Account(); - $account->password_hash_strategy = Account::PASS_HASH_STRATEGY_OLD_ELY; - $model = new InitStateForm($account); - $model->validateAccountPasswordHashStrategy('email'); - expect($model->getErrors('email'))->equals(['error.old_hash_strategy']); - }); - - $this->specify('no errors on modern password hash strategy', function() { - $account = new Account(); - $account->password_hash_strategy = Account::PASS_HASH_STRATEGY_YII2; - $model = new InitStateForm($account); - $model->validateAccountPasswordHashStrategy('email'); - expect($model->getErrors('email'))->isEmpty(); - }); - } - public function testCreateCode() { $this->specify('create valid code and store it to database', function() { /** @var Account $account */