13
13
14
14
use Symfony \Component \HttpClient \MockHttpClient ;
15
15
use Symfony \Component \Notifier \Bridge \LineNotify \LineNotifyTransport ;
16
- use Symfony \Component \Notifier \Exception \LengthException ;
17
16
use Symfony \Component \Notifier \Exception \TransportException ;
18
17
use Symfony \Component \Notifier \Message \ChatMessage ;
19
18
use Symfony \Component \Notifier \Message \MessageInterface ;
@@ -48,16 +47,6 @@ public function unsupportedMessagesProvider(): iterable
48
47
yield [$ this ->createMock (MessageInterface::class)];
49
48
}
50
49
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
-
61
50
public function testSendWithErrorResponseThrows ()
62
51
{
63
52
$ response = $ this ->createMock (ResponseInterface::class);
@@ -66,7 +55,7 @@ public function testSendWithErrorResponseThrows()
66
55
->willReturn (400 );
67
56
$ response ->expects ($ this ->once ())
68
57
->method ('getContent ' )
69
- ->willReturn (json_encode (['message ' => 'testDescription ' , 'code ' => 'testErrorCode ' ]));
58
+ ->willReturn (json_encode (['message ' => 'testDescription ' , 'code ' => 'testErrorCode ' , ' status ' => ' testStatus ' ]));
70
59
71
60
$ client = new MockHttpClient (static function () use ($ response ): ResponseInterface {
72
61
return $ response ;
@@ -75,7 +64,7 @@ public function testSendWithErrorResponseThrows()
75
64
$ transport = $ this ->createTransport ($ client );
76
65
77
66
$ this ->expectException (TransportException::class);
78
- $ this ->expectExceptionMessageMatches ('/testDescription.+testErrorCode / ' );
67
+ $ this ->expectExceptionMessageMatches ('/testMessage.+testDescription / ' );
79
68
80
69
$ transport ->send (new ChatMessage ('testMessage ' ));
81
70
}
0 commit comments