-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathTaqnyatTest.php
More file actions
39 lines (31 loc) · 911 Bytes
/
TaqnyatTest.php
File metadata and controls
39 lines (31 loc) · 911 Bytes
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
<?php
namespace Utopia\Tests\Adapter\SMS;
use Utopia\Messaging\Adapter\SMS\Taqnyat;
use Utopia\Messaging\Messages\SMS;
use Utopia\Tests\Adapter\Base;
class TaqnyatTest extends Base
{
/**
* @throws \Exception
*/
public function testSendSMS(): void
{
// Environment variables
$apiKey = \getenv('TAQNYAT_API_KEY');
$senderId = \getenv('TAQNYAT_SENDER_ID');
$to = \getenv('TAQNYAT_TO');
if (!$apiKey || !$senderId || !$to) {
$this->markTestSkipped('TAQNYAT credentials not configured');
}
$sender = new Taqnyat(
apiKey: $apiKey,
senderId: $senderId
);
$message = new SMS(
to: [$to],
content: 'Test Content',
);
$response = $sender->send($message);
$this->assertResponse($response);
}
}