mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Исправлен баг с ссылками в email с активацией
This commit is contained in:
@ -97,16 +97,25 @@ class RegistrationFormTest extends TestCase {
|
||||
'username' => 'some_username',
|
||||
'email' => 'some_email@example.com',
|
||||
])->exists(), 'user model exists in database');
|
||||
$this->assertTrue(EmailActivation::find()->andWhere([
|
||||
'account_id' => $account->id,
|
||||
'type' => EmailActivation::TYPE_REGISTRATION_EMAIL_CONFIRMATION,
|
||||
])->exists(), 'email activation code exists in database');
|
||||
/** @var EmailActivation $activation */
|
||||
$activation = EmailActivation::find()
|
||||
->andWhere([
|
||||
'account_id' => $account->id,
|
||||
'type' => EmailActivation::TYPE_REGISTRATION_EMAIL_CONFIRMATION,
|
||||
])
|
||||
->one();
|
||||
$this->assertInstanceOf(EmailActivation::class, $activation, 'email activation code exists in database');
|
||||
$this->assertTrue(UsernameHistory::find()->andWhere([
|
||||
'username' => $account->username,
|
||||
'account_id' => $account->id,
|
||||
'applied_in' => $account->created_at,
|
||||
])->exists(), 'username history record exists in database');
|
||||
$this->tester->canSeeEmailIsSent(1);
|
||||
/** @var \yii\swiftmailer\Message $email */
|
||||
$email = $this->tester->grabSentEmails()[0];
|
||||
$body = $email->getSwiftMessage()->getBody();
|
||||
$this->assertContains($activation->key, $body);
|
||||
$this->assertContains('/activation/' . $activation->key, $body);
|
||||
}
|
||||
|
||||
private function mockRequest($ip = '88.225.20.236') {
|
||||
|
Reference in New Issue
Block a user