Skip to content

Commit 14736ca

Browse files
Merge branch '6.2' into 6.3
* 6.2: [Cache] fix trying to load Memcached before checking we can add missing variable [Notifier] Make `TransportTestCase` data providers static Fix PHPUnit 9.6 deprecations [Notifier] Add missing use statement [Security] fix compat with security-core v6 use proper methods to assert exception messages contain certain strings Fix tests replace usages of the deprecated PHPUnit getMockClass() method [gha] Fix high-deps to run with Symfony 6+ Fix PHPDoc (wrong order)
2 parents 5dc74c2 + eb2f9ce commit 14736ca

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()
@@ -59,7 +62,7 @@ public function testSendWithEmptyArrayResponseThrowsTransportException()
5962

6063
$client = new MockHttpClient(static fn (): ResponseInterface => $response);
6164

62-
$transport = $this->createTransport($client);
65+
$transport = self::createTransport($client);
6366

6467
$this->expectException(TransportException::class);
6568

@@ -82,7 +85,7 @@ public function testSendWithErrorResponseThrowsTransportException()
8285

8386
$client = new MockHttpClient(static fn (): ResponseInterface => $response);
8487

85-
$transport = $this->createTransport($client);
88+
$transport = self::createTransport($client);
8689

8790
$transport->send(new ChatMessage('testMessage'));
8891
}
@@ -126,7 +129,7 @@ public function testSendWithOptions()
126129

127130
return $response;
128131
});
129-
$transport = $this->createTransport($client);
132+
$transport = self::createTransport($client);
130133

131134
$transport->send(new ChatMessage($message));
132135
}
@@ -174,7 +177,7 @@ public function testSendWithNotification()
174177
return $response;
175178
});
176179

177-
$transport = $this->createTransport($client);
180+
$transport = self::createTransport($client);
178181

179182
$transport->send($chatMessage);
180183
}
@@ -185,7 +188,7 @@ public function testSendWithInvalidOptions()
185188

186189
$client = new MockHttpClient(fn (string $method, string $url, array $options = []): ResponseInterface => $this->createMock(ResponseInterface::class));
187190

188-
$transport = $this->createTransport($client);
191+
$transport = self::createTransport($client);
189192

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

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)