8000 bug #50352 [Notifier][TurboSMS] Fix get sender name (ZhukV) · symfony/symfony@bf262b9 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit bf262b9

Browse files
bug #50352 [Notifier][TurboSMS] Fix get sender name (ZhukV)
This PR was merged into the 6.2 branch. Discussion ---------- [Notifier][TurboSMS] Fix get sender name | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT Fix get sender name in Turbo Sms Transport. Commits ------- d3486dd Fix get sender name in turbosms notifier
2 parents 752378c + d3486dd commit bf262b9

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Symfony/Component/Notifier/Bridge/TurboSms/Tests/TurboSmsTransportTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,16 @@ public function testSuccessfulSend()
7171
]))
7272
;
7373

74-
$client = new MockHttpClient(static function () use ($response): ResponseInterface {
74+
$client = new MockHttpClient(static function (string $method, string $url, array $options) use ($response): ResponseInterface {
75+
$body = json_decode($options['body'], true);
76+
self::assertSame([
77+
'sms' => [
78+
'sender' => 'sender',
79+
'recipients' => ['380931234567'],
80+
'text' => 'Тест/Test',
81+
],
82+
], $body);
83+
7584
return $response;
7685
});
7786

src/Symfony/Component/Notifier/Bridge/TurboSms/TurboSmsTransport.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ protected function doSend(MessageInterface $message): SentMessage
6666
$this->assertValidSubject($message->getSubject());
6767

6868
$fromMessage = $message->getFrom();
69-
if (null !== $fromMessage) {
69+
70+
if ($fromMessage) {
7071
$this->assertValidFrom($fromMessage);
7172
$from = $fromMessage;
7273
} else {

0 commit comments

Comments
 (0)
0