mirror of
https://github.com/elyby/accounts.git
synced 2024-11-30 02:32:26 +05:30
Немного приемственности в именовании сущностей
This commit is contained in:
parent
c6547b6540
commit
15922ba02e
@ -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();
|
||||
|
@ -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,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -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(), [
|
@ -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,
|
||||
],
|
||||
];
|
||||
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user