diff --git a/Tests/Transport/PostmarkTransportFactoryTest.php b/Tests/Transport/PostmarkTransportFactoryTest.php index ccbd1f1..33a6b66 100644 --- a/Tests/Transport/PostmarkTransportFactoryTest.php +++ b/Tests/Transport/PostmarkTransportFactoryTest.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Mailer\Bridge\Postmark\Tests\Transport; +use Psr\Log\NullLogger; +use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkApiTransport; use Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkSmtpTransport; use Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkTransportFactory; @@ -20,9 +22,9 @@ class PostmarkTransportFactoryTest extends TransportFactoryTestCase { - public static function getFactory(): TransportFactoryInterface + public function getFactory(): TransportFactoryInterface { - return new PostmarkTransportFactory(self::getDispatcher(), self::getClient(), self::getLogger()); + return new PostmarkTransportFactory(null, new MockHttpClient(), new NullLogger()); } public static function supportsProvider(): iterable @@ -55,42 +57,41 @@ public static function supportsProvider(): iterable public static function createProvider(): iterable { - $dispatcher = self::getDispatcher(); - $logger = self::getLogger(); + $logger = new NullLogger(); yield [ new Dsn('postmark+api', 'default', self::USER), - new PostmarkApiTransport(self::USER, self::getClient(), $dispatcher, $logger), + new PostmarkApiTransport(self::USER, new MockHttpClient(), null, $logger), ]; yield [ new Dsn('postmark+api', 'example.com', self::USER, '', 8080), - (new PostmarkApiTransport(self::USER, self::getClient(), $dispatcher, $logger))->setHost('example.com')->setPort(8080), + (new PostmarkApiTransport(self::USER, new MockHttpClient(), null, $logger))->setHost('example.com')->setPort(8080), ]; yield [ new Dsn('postmark+api', 'example.com', self::USER, '', 8080, ['message_stream' => 'broadcasts']), - (new PostmarkApiTransport(self::USER, self::getClient(), $dispatcher, $logger))->setHost('example.com')->setPort(8080)->setMessageStream('broadcasts'), + (new PostmarkApiTransport(self::USER, new MockHttpClient(), null, $logger))->setHost('example.com')->setPort(8080)->setMessageStream('broadcasts'), ]; yield [ new Dsn('postmark', 'default', self::USER), - new PostmarkSmtpTransport(self::USER, $dispatcher, $logger), + new PostmarkSmtpTransport(self::USER, null, $logger), ]; yield [ new Dsn('postmark+smtp', 'default', self::USER), - new PostmarkSmtpTransport(self::USER, $dispatcher, $logger), + new PostmarkSmtpTransport(self::USER, null, $logger), ]; yield [ new Dsn('postmark+smtps', 'default', self::USER), - new PostmarkSmtpTransport(self::USER, $dispatcher, $logger), + new PostmarkSmtpTransport(self::USER, null, $logger), ]; yield [ new Dsn('postmark+smtps', 'default', self::USER, null, null, ['message_stream' => 'broadcasts']), - (new PostmarkSmtpTransport(self::USER, $dispatcher, $logger))->setMessageStream('broadcasts'), + (new PostmarkSmtpTransport(self::USER, null, $logger))->setMessageStream('broadcasts'), ]; } diff --git a/composer.json b/composer.json index d0081d2..77ff532 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,7 @@ ], "require": { "php": ">=8.1", + "psr/event-dispatcher": "^1", "symfony/mailer": "^5.4.21|^6.2.7" }, "require-dev": {