-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathSMSGateAppTest.php
More file actions
41 lines (32 loc) · 1.17 KB
/
SMSGateAppTest.php
File metadata and controls
41 lines (32 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Utopia\Tests\Adapter\SMS;
use Utopia\Messaging\Adapter\SMS\SMSGateApp;
use Utopia\Messaging\Messages\SMS;
use Utopia\Tests\Adapter\Base;
class SMSGateAppTest extends Base {
/**
* Test sending SMS message with SMSGateApp
*/
public function testSendSMS(): void {
// Environment variables for credentials
$username = \getenv('SMSGATEAPP_USERNAME');
$password = \getenv('SMSGATEAPP_PASSWORD');
$to = \getenv('SMSGATEAPP_TO');
if (!$username || !$password || !$to) {
$this->markTestSkipped('SMSGateApp credentials not configured');
}
// Optional API endpoint if set
$endpoint = \getenv('SMSGATEAPP_ENDPOINT') ?? null;
// Instantiate SMSGateApp
$sender = new SMSGateApp($username, $password, $endpoint);
// Create SMS message with required 'to' parameter
$message = new SMS(
to: [$to],
content: 'Test content from SMSGateApp'
);
// Call send() and verify response
$response = $sender->send($message);
// Assertion to match expected response formatting
$this->assertResponse($response);
}
}