Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a87852

Browse files
committed
[Notifier][Line] Fix tests
1 parent 46df55e commit 9a87852

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)