[FrameworkBundle] Use MailerAssertionsTrait in KernelTestCase
This commit is contained in:
parent
9b0a75cdf3
commit
1b1ab2991a
@ -55,6 +55,7 @@ CHANGELOG
|
||||
* Made `framework.session.handler_id` accept a DSN
|
||||
* Marked the `RouterDataCollector` class as `@final`.
|
||||
* [BC Break] The `framework.messenger.buses.<name>.middleware` config key is not deeply merged anymore.
|
||||
* Moved `MailerAssertionsTrait` in `KernelTestCase`
|
||||
|
||||
4.3.0
|
||||
-----
|
||||
|
@ -23,6 +23,8 @@ use Symfony\Contracts\Service\ResetInterface;
|
||||
*/
|
||||
abstract class KernelTestCase extends TestCase
|
||||
{
|
||||
use MailerAssertionsTrait;
|
||||
|
||||
protected static $class;
|
||||
|
||||
/**
|
||||
|
@ -118,10 +118,6 @@ trait MailerAssertionsTrait
|
||||
|
||||
private static function getMessageMailerEvents(): MessageEvents
|
||||
{
|
||||
if (!self::getClient()->getRequest()) {
|
||||
static::fail('Unable to make email assertions. Did you forget to make an HTTP request?');
|
||||
}
|
||||
|
||||
if (!$logger = self::$container->get('mailer.logger_message_listener')) {
|
||||
static::fail('A client must have Mailer enabled to make email assertions. Did you forget to require symfony/mailer?');
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
|
||||
abstract class WebTestCase extends KernelTestCase
|
||||
{
|
||||
use WebTestAssertionsTrait;
|
||||
use MailerAssertionsTrait;
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
|
Reference in New Issue
Block a user