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 */