1
1
<?php
2
+
2
3
/*
3
4
* This file is part of the Symfony package.
4
5
*
22
23
23
24
final class RingCentralTransportTest extends TransportTestCase
24
25
{
25
- public function createTransport (HttpClientInterface $ client = null , string $ from = 'from ' ): RingCentralTransport {
26
+ public function createTransport (HttpClientInterface $ client = null , string $ from = 'from ' ): RingCentralTransport
27
+ {
26
28
return new RingCentralTransport ('apiToken ' , $ from , $ client ?? $ this ->createMock (HttpClientInterface::class));
27
29
}
28
30
@@ -40,7 +42,7 @@ public function supportedMessagesProvider(): iterable
40
42
/**
41
43
* @dataProvider invalidFromProvider
42
44
*/
43
- public function testInvalidArgumentExceptionIsThrownIfFromIsInvalid (string $ from ): void
45
+ public function testInvalidArgumentExceptionIsThrownIfFromIsInvalid (string $ from )
44
46
{
45
47
$ transport = $ this ->createTransport (null , $ from );
46
48
@@ -53,18 +55,18 @@ public function testInvalidArgumentExceptionIsThrownIfFromIsInvalid(string $from
53
55
/**
54
56
* @dataProvider validFromProvider
55
57
*/
56
- public function testNoInvalidArgumentExceptionIsThrownIfFromIsValid (string $ from ): void
58
+ public function testNoInvalidArgumentExceptionIsThrownIfFromIsValid (string $ from )
57
59
{
58
- $ message = new SmsMessage ('+33612345678 ' ,'Hello! ' );
60
+ $ message = new SmsMessage ('+33612345678 ' , 'Hello! ' );
59
61
$ response = $ this ->createMock (ResponseInterface::class);
60
62
$ response ->expects (self ::exactly (2 ))->method ('getStatusCode ' )->willReturn (200 );
61
63
$ response ->expects (self ::once ())->method ('getContent ' )->willReturn (json_encode (['id ' => 'foo ' ]));
62
64
$ client = new MockHttpClient (function (string $ method , string $ url ) use ($ response ): ResponseInterface {
63
- self ::assertSame ('POST ' , $ method );
64
- self ::assertSame ('https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/sms ' , $ url );
65
+ self ::assertSame ('POST ' , $ method );
66
+ self ::assertSame ('https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/sms ' , $ url );
65
67
66
- return $ response ;
67
- }
68
+ return $ response ;
69
+ }
68
70
);
69
71
$ transport = $ this ->createTransport ($ client , $ from );
70
72
$ sentMessage = $ transport ->send ($ message );
0 commit comments