mirror of
https://github.com/elyby/accounts.git
synced 2025-01-13 23:42:16 +05:30
Исправлено поведение формы регистрации
This commit is contained in:
parent
2580119180
commit
298f57841f
@ -5,6 +5,7 @@ use api\components\ReCaptcha\Validator as ReCaptchaValidator;
|
|||||||
use common\components\UserFriendlyRandomKey;
|
use common\components\UserFriendlyRandomKey;
|
||||||
use common\models\Account;
|
use common\models\Account;
|
||||||
use common\models\EmailActivation;
|
use common\models\EmailActivation;
|
||||||
|
use Ramsey\Uuid\Uuid;
|
||||||
use Yii;
|
use Yii;
|
||||||
use yii\base\ErrorException;
|
use yii\base\ErrorException;
|
||||||
|
|
||||||
@ -62,6 +63,7 @@ class RegistrationForm extends BaseApiForm {
|
|||||||
$transaction = Yii::$app->db->beginTransaction();
|
$transaction = Yii::$app->db->beginTransaction();
|
||||||
try {
|
try {
|
||||||
$account = new Account();
|
$account = new Account();
|
||||||
|
$account->uuid = Uuid::uuid4();
|
||||||
$account->email = $this->email;
|
$account->email = $this->email;
|
||||||
$account->username = $this->username;
|
$account->username = $this->username;
|
||||||
$account->password = $this->password;
|
$account->password = $this->password;
|
||||||
|
@ -93,6 +93,7 @@ class RegistrationFormTest extends DbTestCase {
|
|||||||
|
|
||||||
expect('user should be valid', $user)->isInstanceOf(Account::class);
|
expect('user should be valid', $user)->isInstanceOf(Account::class);
|
||||||
expect('password should be correct', $user->validatePassword('some_password'))->true();
|
expect('password should be correct', $user->validatePassword('some_password'))->true();
|
||||||
|
expect('uuid is set', $user->uuid)->notEmpty();
|
||||||
expect('user model exists in database', Account::find()->andWhere([
|
expect('user model exists in database', Account::find()->andWhere([
|
||||||
'username' => 'some_username',
|
'username' => 'some_username',
|
||||||
'email' => 'some_email@example.com',
|
'email' => 'some_email@example.com',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user