|
16 | 16 | use Symfony\Component\Notifier\Message\MessageInterface;
|
17 | 17 | use Symfony\Component\Notifier\Message\SmsMessage;
|
18 | 18 | use Symfony\Component\Notifier\Test\TransportTestCase;
|
| 19 | +use Symfony\Component\Notifier\Tests\Fixtures\DummyHttpClient; |
| 20 | +use Symfony\Component\Notifier\Tests\Fixtures\DummyMessage; |
| 21 | +use Symfony\Component\Notifier\Transport\TransportInterface; |
19 | 22 | use Symfony\Contracts\HttpClient\HttpClientInterface;
|
20 | 23 |
|
21 | 24 | final class ZulipTransportTest extends TransportTestCase
|
22 | 25 | {
|
23 |
| - public function createTransport(HttpClientInterface $client = null): ZulipTransport |
| 26 | + public static function createTransport(HttpClientInterface $client = null): ZulipTransport |
24 | 27 | {
|
25 |
| - return (new ZulipTransport('testEmail', 'testToken', 'testChannel', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('test.host'); |
| 28 | + return (new ZulipTransport('testEmail', 'testToken', 'testChannel', $client ?? new DummyHttpClient()))->setHost('test.host'); |
26 | 29 | }
|
27 | 30 |
|
28 |
| - public function toStringProvider(): iterable |
| 31 | + public static function toStringProvider(): iterable |
29 | 32 | {
|
30 |
| - yield ['zulip://test.host?channel=testChannel', $this->createTransport()]; |
| 33 | + yield ['zulip://test.host?channel=testChannel', self::createTransport()]; |
31 | 34 | }
|
32 | 35 |
|
33 |
| - public function supportedMessagesProvider(): iterable |
| 36 | + public static function supportedMessagesProvider(): iterable |
34 | 37 | {
|
35 | 38 | yield [new ChatMessage('Hello!')];
|
36 | 39 | }
|
37 | 40 |
|
38 |
| - public function unsupportedMessagesProvider(): iterable |
| 41 | + public static function unsupportedMessagesProvider(): iterable |
39 | 42 | {
|
40 | 43 | yield [new SmsMessage('0611223344', 'Hello!')];
|
41 |
| - yield [$this->createMock(MessageInterface::class)]; |
| 44 | + yield [new DummyMessage()]; |
42 | 45 | }
|
43 | 46 | }
|
0 commit comments