-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathTermiiTest.php
More file actions
35 lines (28 loc) · 828 Bytes
/
TermiiTest.php
File metadata and controls
35 lines (28 loc) · 828 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
<?php
namespace Tests\E2E;
use Utopia\Messaging\Adapters\SMS\Termii;
use Utopia\Messaging\Messages\SMS;
class TermiiTest extends Base
{
/**
* @throws \Exception
*/
public function testSendSMS()
{
$apiKey = getenv('TERMII_API_KEY');
$to = [getenv('TERMII_TO')];
$from = getenv('TERMII_FROM');
$sender = new Termii($apiKey);
$message = new SMS(
to: $to,
content: 'Test Content',
from: $from
);
$response = $sender->send($message);
$result = \json_decode($response, true);
$this->assertArrayNotHasKey('errors', $result);
$this->assertArrayHasKey('message_id', $result);
$this->assertArrayHasKey('message', $result);
$this->assertArrayHasKey('balance', $result);
}
}