File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ protected function doSend(MessageInterface $message): SentMessage
8787

8888
$response = $this->client->request('POST', $endpoint, [
8989
'auth_basic' => [$this->apiUsername, $this->apiKey],
90-
'json' => array_filter($options),
90+
'json' => ['messages' => [array_filter($options)]],
9191
]);
9292

9393
try {
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,14 @@ public function testNoInvalidArgumentExceptionIsThrownIfFromIsValid(string $from
6363
$response = $this->createMock(ResponseInterface::class);
6464
$response->expects(self::exactly(2))->method('getStatusCode')->willReturn(200);
6565
$response->expects(self::once())->method('getContent')->willReturn('');
66-
$client = new MockHttpClient(function (string $method, string $url) use ($response): ResponseInterface {
66+
$client = new MockHttpClient(function (string $method, string $url, array $options) use ($response): ResponseInterface {
6767
self::assertSame('POST', $method);
6868
self::assertSame('https://rest.clicksend.com/v3/sms/send', $url);
6969

70+
$body = json_decode($options['body'], true);
71+
self::assertIsArray($body);
72+
self::assertArrayHasKey('messages', $body);
73+
7074
return $response;
7175
});
7276
$transport = $this->createTransport($client, $from);

0 commit comments

Comments
 (0)