File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212namespace Symfony \Component \Notifier \Bridge \RingCentral \Tests ;
1313
1414use Symfony \Component \HttpClient \MockHttpClient ;
15+ use Symfony \Component \HttpClient \Response \MockResponse ;
1516use Symfony \Component \Notifier \Bridge \RingCentral \RingCentralOptions ;
1617use Symfony \Component \Notifier \Bridge \RingCentral \RingCentralTransport ;
1718use Symfony \Component \Notifier \Exception \InvalidArgumentException ;
@@ -60,14 +61,11 @@ public function testInvalidArgumentExceptionIsThrownIfFromIsInvalid(string $from
6061 public function testNoInvalidArgumentExceptionIsThrownIfFromIsValid (string $ from )
6162 {
6263 $ message = new SmsMessage ('+33612345678 ' , 'Hello! ' );
63- $ response = $ this ->createMock (ResponseInterface::class);
64- $ response ->expects (self ::exactly (2 ))->method ('getStatusCode ' )->willReturn (200 );
65- $ response ->expects (self ::once ())->method ('getContent ' )->willReturn (json_encode (['id ' => 'foo ' ]));
66- $ client = new MockHttpClient (function (string $ method , string $ url ) use ($ response ): ResponseInterface {
64+ $ client = new MockHttpClient (function (string $ method , string $ url ): ResponseInterface {
6765 self ::assertSame ('POST ' , $ method );
6866 self ::assertSame ('https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/sms ' , $ url );
6967
70- return $ response ;
68+ return new MockResponse ( json_encode ([ ' id ' => ' foo ' ])) ;
7169 }
7270 );
7371 $ transport = $ this ->createTransport ($ client , $ from );
You can’t perform that action at this time.
0 commit comments