From 15922ba02e8c56675d6b74c5d051fd9a33d12025 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Tue, 10 May 2016 23:28:04 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=BC=D0=BD=D0=BE=D0=B3=D0=BE=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=B5=D0=BC=D1=81=D1=82=D0=B2=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20=D0=B2=20=D0=B8=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B8=20=D1=81=D1=83=D1=89?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/models/ForgotPasswordForm.php | 4 ++-- common/models/EmailActivation.php | 2 +- .../confirmations/{RecoverPassword.php => ForgotPassword.php} | 2 +- tests/codeception/common/fixtures/data/email-activations.php | 2 +- tests/codeception/common/unit/models/EmailActivationTest.php | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) rename common/models/confirmations/{RecoverPassword.php => ForgotPassword.php} (91%) 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); }); }