File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
use Symfony\Component\Notifier\Message\MessageInterface;
2020
use Symfony\Component\Notifier\Message\SmsMessage;
2121
use Symfony\Component\Notifier\Test\TransportTestCase;
22+
use Symfony\Component\Notifier\Tests\Fixtures\DummyHttpClient;
23+
use Symfony\Component\Notifier\Tests\Fixtures\DummyMessage;
2224
use Symfony\Component\Notifier\Transport\TransportInterface;
2325
use Symfony\Contracts\HttpClient\HttpClientInterface;
2426
use Symfony\Contracts\HttpClient\ResponseInterface;
@@ -28,26 +30,26 @@ final class MessageMediaTransportTest extends TransportTestCase
2830
/**
2931
* @return MessageMediaTransport
3032
*/
31-
public function createTransport(HttpClientInterface $client = null, string $from = null): TransportInterface
33+
public static function createTransport(HttpClientInterface $client = null, string $from = null): TransportInterface
3234
{
33-
return new MessageMediaTransport('apiKey', 'apiSecret', $from, $client ?? $this->createMock(HttpClientInterface::class));
35+
return new MessageMediaTransport('apiKey', 'apiSecret', $from, $client ?? new DummyHttpClient());
3436
}
3537

36-
public function toStringProvider(): iterable
38+
public static function toStringProvider(): iterable
3739
{
38-
yield ['messagemedia://api.messagemedia.com', $this->createTransport()];
39-
yield ['messagemedia://api.messagemedia.com?from=TEST', $this->createTransport(null, 'TEST')];
40+
yield ['messagemedia://api.messagemedia.com', self::createTransport()];
41+
yield ['messagemedia://api.messagemedia.com?from=TEST', self::createTransport(null, 'TEST')];
4042
}
4143

42-
public function supportedMessagesProvider(): iterable
44+
public static function supportedMessagesProvider(): iterable
4345
{
4446
yield [new SmsMessage('0491570156', 'Hello!')];
4547
}
4648

47-
public function unsupportedMessagesProvider(): iterable
49+
public static function unsupportedMessagesProvider(): iterable
4850
{
4951
yield [new ChatMessage('Hello!')];
50-
yield [$this->createMock(MessageInterface::class)];
52+
yield [new DummyMessage()];
5153
}
5254

5355
/**
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=7.2.5",
2020
"symfony/http-client": "^4.4|^5.2|^6.0",
21-
"symfony/notifier": "^5.3|^6.0"
21+
"symfony/notifier": "^5.4.21|^6.2.7"
2222
},
2323
"autoload": {
2424
"psr-4": { "Symfony\\Component\\Notifier\\Bridge\\MessageMedia\\": "" },

0 commit comments

Comments
 (0)