From 1f761b5f4103f372da3cb3f1141024cb1d0735da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 26 Jun 2025 18:01:16 +0000 Subject: [PATCH] Make mock SMS customizable --- src/Utopia/Messaging/Adapter/SMS/Mock.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Utopia/Messaging/Adapter/SMS/Mock.php b/src/Utopia/Messaging/Adapter/SMS/Mock.php index 9f39cd33..ee141604 100644 --- a/src/Utopia/Messaging/Adapter/SMS/Mock.php +++ b/src/Utopia/Messaging/Adapter/SMS/Mock.php @@ -10,6 +10,8 @@ class Mock extends SMSAdapter { protected const NAME = 'Mock'; + protected string $url = 'http://request-catcher:5000/mock-sms'; + /** * @param string $user User ID * @param string $secret User secret @@ -25,6 +27,17 @@ public function getName(): string return static::NAME; } + public function getEndpoint(): string + { + return $this->url; + } + + public function setEndpoint(string $url): self + { + $this->url = $url; + return $this; + } + public function getMaxMessagesPerRequest(): int { return 1000; @@ -43,7 +56,7 @@ protected function process(SMSMessage $message): array $result = $this->request( method: 'POST', - url: 'http://request-catcher:5000/mock-sms', + url: $this->url, headers: [ 'Content-Type: application/json', "X-Username: {$this->user}",