Files
backend/tests/Service/SmsruClientServiceTest.php
2026-05-27 19:36:32 +03:00

46 lines
1.0 KiB
PHP

<?php
namespace Tests\Service;
use App\Service\Client\SmsruClientService;
use PHPUnit\Framework\TestCase;
class SmsruClientServiceTest extends TestCase
{
private SmsruClientService $smsClient;
protected function setUp(): void
{
$userAgent = $_ENV['API_CLIENT'];
$baseUrl = $_ENV['SMSRU_URL'];
$token = $_ENV['SMSRU_TOKEN'];
$sender = $_ENV['SMSRU_SENDER'];
$this->smsClient = new SmsruClientService($userAgent, $baseUrl, $token, $sender);
}
public function testBalance()
{
$result = $this->smsClient->balance();
$this->assertIsArray($result);
}
public function testSenders()
{
$result = $this->smsClient->senders();
$this->assertIsArray($result);
}
public function testSendSms()
{
$to = '79996243200';
$msg = 'Тест smsru интерфейса.';
$result = $this->smsClient->send($to, $msg);
$this->assertIsArray($result);
}
}