1313
1414use Symfony \Component \HttpClient \MockHttpClient ;
1515use Symfony \Component \Notifier \Bridge \LineNotify \LineNotifyTransport ;
16- use Symfony \Component \Notifier \Exception \LengthException ;
1716use Symfony \Component \Notifier \Exception \TransportException ;
1817use Symfony \Component \Notifier \Message \ChatMessage ;
1918use 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