Skip to content

Commit 9e132b6

Browse files
[Notifier] Make TransportTestCase data providers static
1 parent fcd9a66 commit 9e132b6

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Tests/ZulipTransportTest.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use Symfony\Component\Notifier\Message\MessageInterface;
1717
use Symfony\Component\Notifier\Message\SmsMessage;
1818
use Symfony\Component\Notifier\Test\TransportTestCase;
19+
use Symfony\Component\Notifier\Tests\Fixtures\DummyHttpClient;
20+
use Symfony\Component\Notifier\Tests\Fixtures\DummyMessage;
1921
use Symfony\Component\Notifier\Transport\TransportInterface;
2022
use Symfony\Contracts\HttpClient\HttpClientInterface;
2123

@@ -24,24 +26,24 @@ final class ZulipTransportTest extends TransportTestCase
2426
/**
2527
* @return ZulipTransport
2628
*/
27-
public function createTransport(HttpClientInterface $client = null): TransportInterface
29+
public static function createTransport(HttpClientInterface $client = null): TransportInterface
2830
{
29-
return (new ZulipTransport('testEmail', 'testToken', 'testChannel', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('test.host');
31+
return (new ZulipTransport('testEmail', 'testToken', 'testChannel', $client ?? new DummyHttpClient()))->setHost('test.host');
3032
}
3133

32-
public function toStringProvider(): iterable
34+
public static function toStringProvider(): iterable
3335
{
34-
yield ['zulip://test.host?channel=testChannel', $this->createTransport()];
36+
yield ['zulip://test.host?channel=testChannel', self::createTransport()];
3537
}
3638

37-
public function supportedMessagesProvider(): iterable
39+
public static function supportedMessagesProvider(): iterable
3840
{
3941
yield [new ChatMessage('Hello!')];
4042
}
4143

42-
public function unsupportedMessagesProvider(): iterable
44+
public static function unsupportedMessagesProvider(): iterable
4345
{
4446
yield [new SmsMessage('0611223344', 'Hello!')];
45-
yield [$this->createMock(MessageInterface::class)];
47+
yield [new DummyMessage()];
4648
}
4749
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=7.2.5",
2020
"symfony/http-client": "^4.3|^5.0|^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\\Zulip\\": "" },

0 commit comments

Comments
 (0)