mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
При попытке запроса смены E-mail теперь происходит проверка, как давно был выполнен предыдущий запрос
This commit is contained in:
@@ -62,14 +62,15 @@ class NewEmailFormTest extends DbTestCase {
|
||||
public function testSendNewEmailConfirmation() {
|
||||
$this->specify('send email', function() {
|
||||
/** @var Account $account */
|
||||
$account = Account::findOne($this->accounts['admin']['id']);
|
||||
$account = Account::findOne($this->accounts['account-with-change-email-init-state']['id']);
|
||||
/** @var NewEmailForm $model */
|
||||
$key = $this->emailActivations['currentChangeEmailConfirmation']['key'];
|
||||
$model = new NewEmailForm($account, [
|
||||
'key' => $this->emailActivations['currentEmailConfirmation']['key'],
|
||||
'key' => $key,
|
||||
'email' => 'my-new-email@ely.by',
|
||||
]);
|
||||
expect($model->sendNewEmailConfirmation())->true();
|
||||
expect(EmailActivation::findOne($this->emailActivations['currentEmailConfirmation']['key']))->null();
|
||||
expect(EmailActivation::findOne($key))->null();
|
||||
expect(EmailActivation::findOne([
|
||||
'account_id' => $account->id,
|
||||
'type' => EmailActivation::TYPE_NEW_EMAIL_CONFIRMATION,
|
||||
|
Reference in New Issue
Block a user