Skip to content

Commit 4785cc7

Browse files
committed
minor #48477 [Notifier] [Line] Fix tests (OskarStark)
This PR was merged into the 6.3 branch. Discussion ---------- [Notifier] [Line] Fix tests | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a Follows * #48466 cc `@kurozumi` Commits ------- 9a87852 [Notifier][Line] Fix tests
2 parents 46df55e + 9a87852 commit 4785cc7

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/Symfony/Component/Notifier/Bridge/LineNotify/Tests/LineNotifyTransportTest.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\HttpClient\MockHttpClient;
1515
use Symfony\Component\Notifier\Bridge\LineNotify\LineNotifyTransport;
16-
use Symfony\Component\Notifier\Exception\LengthException;
1716
use Symfony\Component\Notifier\Exception\TransportException;
1817
use Symfony\Component\Notifier\Message\ChatMessage;
1918
use Symfony\Component\Notifier\Message\MessageInterface;
@@ -48,16 +47,6 @@ public function unsupportedMessagesProvider(): iterable
4847
yield [$this->createMock(MessageInterface::class)];
4948
}
5049

51-
public function testSendChatMessageWithMoreThan2000CharsThrowsLogicException()
52-
{
53-
$transport = $this->createTransport();
54-
55-
$this->expectException(LengthException::class);
56-
$this->expectExceptionMessage('The subject length of a Line message must not exceed 1000 characters.');
57-
58-
$transport->send(new ChatMessage(str_repeat('', 1001)));
59-
}
60-
6150
public function testSendWithErrorResponseThrows()
6251
{
6352
$response = $this->createMock(ResponseInterface::class);
@@ -66,7 +55,7 @@ public function testSendWithErrorResponseThrows()
6655
->willReturn(400);
6756
$response->expects($this->once())
6857
->method('getContent')
69-
->willReturn(json_encode(['message' => 'testDescription', 'code' => 'testErrorCode']));
58+
->willReturn(json_encode(['message' => 'testDescription', 'code' => 'testErrorCode', 'status' => 'testStatus']));
7059

7160
$client = new MockHttpClient(static function () use ($response): ResponseInterface {
7261
return $response;
@@ -75,7 +64,7 @@ public function testSendWithErrorResponseThrows()
7564
$transport = $this->createTransport($client);
7665

7766
$this->expectException(TransportException::class);
78-
$this->expectExceptionMessageMatches('/testDescription.+testErrorCode/');
67+
$this->expectExceptionMessageMatches('/testMessage.+testDescription/');
7968

8069
$transport->send(new ChatMessage('testMessage'));
8170
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy