Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/Utopia/Messaging/Adapter/SMS/Mock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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}",
Expand Down
Loading