|
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 SmscTransportTest extends TransportTestCase
|
22 | 25 | {
|
23 |
| - public function createTransport(HttpClientInterface $client = null): SmscTransport |
| 26 | + public static function createTransport(HttpClientInterface $client = null): SmscTransport |
24 | 27 | {
|
25 |
| - return new SmscTransport('login', 'password', 'MyApp', $client ?? $this->createMock(HttpClientInterface::class)); |
| 28 | + return new SmscTransport('login', 'password', 'MyApp', $client ?? new DummyHttpClient()); |
26 | 29 | }
|
27 | 30 |
|
28 |
| - public function toStringProvider(): iterable |
| 31 | + public static function toStringProvider(): iterable |
29 | 32 | {
|
30 |
| - yield ['smsc://smsc.ru?from=MyApp', $this->createTransport()]; |
| 33 | + yield ['smsc://smsc.ru?from=MyApp', self::createTransport()]; |
31 | 34 | }
|
32 | 35 |
|
33 |
| - public function supportedMessagesProvider(): iterable |
| 36 | + public static function supportedMessagesProvider(): iterable |
34 | 37 | {
|
35 | 38 | yield [new SmsMessage('0611223344', 'Hello!')];
|
36 | 39 | }
|
37 | 40 |
|
38 |
| - public function unsupportedMessagesProvider(): iterable |
| 41 | + public static function unsupportedMessagesProvider(): iterable |
39 | 42 | {
|
40 | 43 | yield [new ChatMessage('Hello!')];
|
41 |
| - yield [$this->createMock(MessageInterface::class)]; |
| 44 | + yield [new DummyMessage()]; |
42 | 45 | }
|
43 | 46 | }
|
0 commit comments