diff --git a/api/models/ForgotPasswordForm.php b/api/models/ForgotPasswordForm.php index a11676b..ddd7944 100644 --- a/api/models/ForgotPasswordForm.php +++ b/api/models/ForgotPasswordForm.php @@ -5,7 +5,7 @@ use api\models\base\ApiForm; use api\traits\AccountFinder; use common\components\UserFriendlyRandomKey; use common\models\Account; -use common\models\confirmations\RecoverPassword; +use common\models\confirmations\ForgotPassword; use common\models\EmailActivation; use Yii; use yii\base\ErrorException; @@ -59,7 +59,7 @@ class ForgotPasswordForm extends ApiForm { $account = $this->getAccount(); $emailActivation = $this->getEmailActivation(); if ($emailActivation === null) { - $emailActivation = new RecoverPassword(); + $emailActivation = new ForgotPassword(); $emailActivation->account_id = $account->id; } else { $emailActivation->created_at = time(); diff --git a/common/models/EmailActivation.php b/common/models/EmailActivation.php index 9599282..463880c 100644 --- a/common/models/EmailActivation.php +++ b/common/models/EmailActivation.php @@ -73,7 +73,7 @@ class EmailActivation extends ActiveRecord { public static function getClassMap() { return [ self::TYPE_REGISTRATION_EMAIL_CONFIRMATION => confirmations\RegistrationConfirmation::class, - self::TYPE_FORGOT_PASSWORD_KEY => confirmations\RecoverPassword::class, + self::TYPE_FORGOT_PASSWORD_KEY => confirmations\ForgotPassword::class, ]; } diff --git a/common/models/confirmations/RecoverPassword.php b/common/models/confirmations/ForgotPassword.php similarity index 91% rename from common/models/confirmations/RecoverPassword.php rename to common/models/confirmations/ForgotPassword.php index c57334f..d72780b 100644 --- a/common/models/confirmations/RecoverPassword.php +++ b/common/models/confirmations/ForgotPassword.php @@ -4,7 +4,7 @@ namespace common\models\confirmations; use common\models\EmailActivation; use yii\helpers\ArrayHelper; -class RecoverPassword extends EmailActivation { +class ForgotPassword extends EmailActivation { public function behaviors() { return ArrayHelper::merge(parent::behaviors(), [ diff --git a/tests/codeception/common/fixtures/data/email-activations.php b/tests/codeception/common/fixtures/data/email-activations.php index b57952b..3e66d47 100644 --- a/tests/codeception/common/fixtures/data/email-activations.php +++ b/tests/codeception/common/fixtures/data/email-activations.php @@ -22,6 +22,6 @@ return [ 'key' => 'H25HBDCHHAG2HGHGHS', 'account_id' => 6, 'type' => \common\models\EmailActivation::TYPE_FORGOT_PASSWORD_KEY, - 'created_at' => time() - (new \common\models\confirmations\RecoverPassword())->repeatTimeout - 10, + 'created_at' => time() - (new \common\models\confirmations\ForgotPassword())->repeatTimeout - 10, ], ]; diff --git a/tests/codeception/common/unit/models/EmailActivationTest.php b/tests/codeception/common/unit/models/EmailActivationTest.php index e9ea7ac..12c221f 100644 --- a/tests/codeception/common/unit/models/EmailActivationTest.php +++ b/tests/codeception/common/unit/models/EmailActivationTest.php @@ -2,7 +2,7 @@ namespace codeception\common\unit\models; use Codeception\Specify; -use common\models\confirmations\RecoverPassword; +use common\models\confirmations\ForgotPassword; use common\models\confirmations\RegistrationConfirmation; use common\models\EmailActivation; use tests\codeception\common\fixtures\EmailActivationFixture; @@ -27,7 +27,7 @@ class EmailActivationTest extends DbTestCase { ]))->isInstanceOf(RegistrationConfirmation::class); expect(EmailActivation::findOne([ 'type' => EmailActivation::TYPE_FORGOT_PASSWORD_KEY, - ]))->isInstanceOf(RecoverPassword::class); + ]))->isInstanceOf(ForgotPassword::class); }); }