Skip to content

Commit eb2f9ce

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 a540830 + 3e6a2fa commit eb2f9ce

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

Tests/LinkedInTransportTest.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,33 @@
2121
use Symfony\Component\Notifier\Message\SmsMessage;
2222
use Symfony\Component\Notifier\Notification\Notification;
2323
use Symfony\Component\Notifier\Test\TransportTestCase;
24+
use Symfony\Component\Notifier\Tests\Fixtures\DummyHttpClient;
25+
use Symfony\Component\Notifier\Tests\Fixtures\DummyMessage;
26+
use Symfony\Component\Notifier\Transport\TransportInterface;
2427
use Symfony\Contracts\HttpClient\HttpClientInterface;
2528
use Symfony\Contracts\HttpClient\ResponseInterface;
2629

2730
final class LinkedInTransportTest extends TransportTestCase
2831
{
29-
public function createTransport(HttpClientInterface $client = null): LinkedInTransport
32+
public static function createTransport(HttpClientInterface $client = null): LinkedInTransport
3033
{
31-
return (new LinkedInTransport('AuthToken', 'AccountId', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
34+
return (new LinkedInTransport('AuthToken', 'AccountId', $client ?? new DummyHttpClient()))->setHost('host.test');
3235
}
3336

34-
public function toStringProvider(): iterable
37+
public static function toStringProvider(): iterable
3538
{
36-
yield ['linkedin://host.test', $this->createTransport()];
39+
yield ['linkedin://host.test', self::createTransport()];
3740
}
3841

39-
public function supportedMessagesProvider(): iterable
42+
public static function supportedMessagesProvider(): iterable
4043
{
4144
yield [new ChatMessage('Hello!')];
4245
}
4346

44-
public function unsupportedMessagesProvider(): iterable
47+
public static function unsupportedMessagesProvider(): iterable
4548
{
4649
yield [new SmsMessage('0611223344', 'Hello!')];
47-
yield [$this->createMock(MessageInterface::class)];
50+
yield [new DummyMessage()];
4851
}
4952

5053
public function testSendWithEmptyArrayResponseThrowsTransportException()
@@ -61,7 +64,7 @@ public function testSendWithEmptyArrayResponseThrowsTransportException()
6164
return $response;
6265
});
6366

64-
$transport = $this->createTransport($client);
67+
$transport = self::createTransport($client);
6568

6669
$this->expectException(TransportException::class);
6770

@@ -86,7 +89,7 @@ public function testSendWithErrorResponseThrowsTransportException()
8689
return $response;
8790
});
8891

89-
$transport = $this->createTransport($client);
92+
$transport = self::createTransport($client);
9093

9194
$transport->send(new ChatMessage('testMessage'));
9295
}
@@ -130,7 +133,7 @@ public function testSendWithOptions()
130133

131134
return $response;
132135
});
133-
$transport = $this->createTransport($client);
136+
$transport = self::createTransport($client);
134137

135138
$transport->send(new ChatMessage($message));
136139
}
@@ -178,7 +181,7 @@ public function testSendWithNotification()
178181
return $response;
179182
});
180183

181-
$transport = $this->createTransport($client);
184+
$transport = self::createTransport($client);
182185

183186
$transport->send($chatMessage);
184187
}
@@ -191,7 +194,7 @@ public function testSendWithInvalidOptions()
191194
return $this->createMock(ResponseInterface::class);
192195
});
193196

194-
$transport = $this->createTransport($client);
197+
$transport = self::createTransport($client);
195198

196199
$transport->send(new ChatMessage('testMessage', $this->createMock(MessageOptionsInterface::class)));
197200
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=8.1",
2020
"symfony/http-client": "^5.4|^6.0",
21-
"symfony/notifier": "^6.2"
21+
"symfony/notifier": "^6.2.7"
2222
},
2323
"autoload": {
2424
"psr-4": { "Symfony\\Component\\Notifier\\Bridge\\LinkedIn\\": "" },

0 commit comments

Comments
 (0)