Remove default swiftmailer dependency (#448)

* replace swiftmailer references with generic interface references
* replace swiftmailer dependency with suggested symfonymailer (option to also use old swiftmailer)
* remove getSwiftMailer fro mtests
* adjuts config to skip yii2 coded swiftmailer
* dev and test only until php 7.4 (synphonymailer)
This commit is contained in:
Tõnis Ormisson
2022-08-11 09:13:10 +03:00
committed by GitHub
parent 78bfbd43b5
commit 8bef4d41cc
8 changed files with 32 additions and 26 deletions

View File

@ -34,12 +34,12 @@ $I->click('Save');
$I->seeRecord(User::className(), ['email' => $user->email, 'unconfirmed_email' => 'new_user@example.com']);
$I->see('A confirmation message has been sent to your new email address');
$user = $I->grabRecord(User::className(), ['id' => $user->id]);
$token = $I->grabRecord(Token::className(), ['user_id' => $user->id, 'type' => Token::TYPE_CONFIRM_NEW_EMAIL]);
/** @var yii\swiftmailer\Message $message */
$user = $I->grabRecord(User::class, ['id' => $user->id]);
$token = $I->grabRecord(Token::class, ['user_id' => $user->id, 'type' => Token::TYPE_CONFIRM_NEW_EMAIL]);
/** @var \yii\mail\MessageInterface $message */
$message = $I->grabLastSentEmail();
$I->assertArrayHasKey($user->unconfirmed_email, $message->getTo());
$I->assertStringContainsString(Html::encode($token->getUrl()), utf8_encode(quoted_printable_decode($message->getSwiftMessage()->toString())));
$I->assertStringContainsString(Html::encode($token->getUrl()), utf8_encode(quoted_printable_decode($message->toString())));
Yii::$app->user->logout();
$I->amGoingTo('log in using new email address before clicking the confirmation link');