Skip to content

Commit 017b16c

Browse files
Merge branch '5.4' into 6.2
* 5.4: [Cache] fix trying to load Memcached before checking we can [Notifier] Make `TransportTestCase` data providers static [Notifier] Add missing use statement
2 parents 850547d + 3b40c3c commit 017b16c

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

Tests/GatewayApiTransportTest.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
use Symfony\Component\HttpClient\MockHttpClient;
1515
use Symfony\Component\Notifier\Bridge\GatewayApi\GatewayApiTransport;
1616
use Symfony\Component\Notifier\Message\ChatMessage;
17-
use Symfony\Component\Notifier\Message\MessageInterface;
1817
use Symfony\Component\Notifier\Message\SentMessage;
1918
use Symfony\Component\Notifier\Message\SmsMessage;
2019
use Symfony\Component\Notifier\Test\TransportTestCase;
20+
use Symfony\Component\Notifier\Tests\Fixtures\DummyHttpClient;
21+
use Symfony\Component\Notifier\Tests\Fixtures\DummyMessage;
22+
use Symfony\Component\Notifier\Transport\TransportInterface;
2123
use Symfony\Contracts\HttpClient\HttpClientInterface;
2224
use Symfony\Contracts\HttpClient\ResponseInterface;
2325

@@ -27,25 +29,25 @@
2729
*/
2830
final class GatewayApiTransportTest extends TransportTestCase
2931
{
30-
public function createTransport(HttpClientInterface $client = null): GatewayApiTransport
32+
public static function createTransport(HttpClientInterface $client = null): GatewayApiTransport
3133
{
32-
return new GatewayApiTransport('authtoken', 'Symfony', $client ?? $this->createMock(HttpClientInterface::class));
34+
return new GatewayApiTransport('authtoken', 'Symfony', $client ?? new DummyHttpClient());
3335
}
3436

35-
public function toStringProvider(): iterable
37+
public static function toStringProvider(): iterable
3638
{
37-
yield ['gatewayapi://gatewayapi.com?from=Symfony', $this->createTransport()];
39+
yield ['gatewayapi://gatewayapi.com?from=Symfony', self::createTransport()];
3840
}
3941

40-
public function supportedMessagesProvider(): iterable
42+
public static function supportedMessagesProvider(): iterable
4143
{
4244
yield [new SmsMessage('0611223344', 'Hello!')];
4345
}
4446

45-
public function unsupportedMessagesProvider(): iterable
47+
public static function unsupportedMessagesProvider(): iterable
4648
{
4749
yield [new ChatMessage('Hello!')];
48-
yield [$this->createMock(MessageInterface::class)];
50+
yield [new DummyMessage()];
4951
}
5052

5153
public function testSend()
@@ -64,7 +66,7 @@ public function testSend()
6466

6567
$message = new SmsMessage('3333333333', 'Hello!');
6668

67-
$transport = $this->createTransport($client);
69+
$transport = self::createTransport($client);
6870
$sentMessage = $transport->send($message);
6971

7072
$this->assertInstanceOf(SentMessage::class, $sentMessage);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"require": {
2323
"php": ">=8.1",
2424
"symfony/http-client": "^5.4|^6.0",
25-
"symfony/notifier": "^6.2"
25+
"symfony/notifier": "^6.2.7"
2626
},
2727
"autoload": {
2828
"psr-4": { "Symfony\\Component\\Notifier\\Bridge\\GatewayApi\\": "" },

0 commit comments

Comments
 (0)