Skip to content

Commit ee06fe2

Browse files
committed
Merge branch '7.2' into 7.3
* 7.2: (21 commits) [FrameworkBundle] Add missing `not-compromised-password` entry in XSD [AssetMapper] Fix CssCompiler matches url in comments Add support for doctrine/persistence 4 fix(sweego): Fix channel parameter value to fixed value for Mailer and Notifier Transports Ensure TransportExceptionInterface populates stream debug data Fix typo in validators.sk.xlf [Mime] Fix body validity check in `Email` when using `Message::setBody()` Review Arabic translations for the validator Fixed mistakes in proper hebrew writing in the previous translation and confirmed the rest to be correct and in the same style. Review translation [Cache] Don't clear system caches on cache:clear [FrameworkBundle] Fix patching refs to the tmp warmup dir in files generated by optional cache warmers [Config] Add missing json_encode flag when creating .meta.json files Mark Czech Validator translation as reviewed [PropertyInfo] Fix `TypeTest` duplicated assert [Validator] Fix `Url` constraint attribute assertion convert legacy types to TypeInfo types if getType() is not implemented [HtmlSanitizer] Avoid accessing non existent array key when checking for hosts validity [Messenger ] Extract retry delay from nested `RecoverableExceptionInterface` Update validators.ar.xlf ...
2 parents 4d56f01 + 6f6e647 commit ee06fe2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Tests/SweegoTransportTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Notifier\Bridge\Sweego\Tests;
1313

1414
use Symfony\Component\HttpClient\MockHttpClient;
15+
use Symfony\Component\HttpClient\Response\JsonMockResponse;
1516
use Symfony\Component\Notifier\Bridge\Sweego\SweegoTransport;
1617
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
1718
use Symfony\Component\Notifier\Message\ChatMessage;
@@ -68,4 +69,22 @@ public function testSendWithInvalidMessageType()
6869
$message = $this->createMock(MessageInterface::class);
6970
$transport->send($message);
7071
}
72+
73+
public function testSendSmsMessage()
74+
{
75+
$client = new MockHttpClient(function ($method, $url, $options) {
76+
$this->assertSame('POST', $method);
77+
$this->assertSame('https://api.sweego.io/send', $url);
78+
79+
$body = json_decode($options['body'], true);
80+
$this->assertSame('sms', $body['channel']);
81+
82+
return new JsonMockResponse(['swg_uids' => ['123']]);
83+
});
84+
85+
$transport = self::createTransport($client);
86+
$sentMessage = $transport->send(new SmsMessage('0611223344', 'Hello!'));
87+
88+
$this->assertSame('123', $sentMessage->getMessageId());
89+
}
7190
}

0 commit comments

Comments
 (0)