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

46 lines
1.0 KiB
PHP

<?php
namespace Tests\Service;
use App\Service\Client\Sms4bClientService;
use PHPUnit\Framework\TestCase;
class Sms4bClientServiceTest extends TestCase
{
private Sms4bClientService $smsClient;
protected function setUp(): void
{
$userAgent = $_ENV['API_CLIENT'];
$baseUrl = $_ENV['SMS4B_URL'];
$token = $_ENV['SMS4B_TOKEN'];
$sender = $_ENV['SMS4B_SENDER'];
$this->smsClient = new Sms4bClientService($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 = 'Тест sms4b интерфейса';
$result = $this->smsClient->send($to, $msg);
$this->assertIsArray($result);
}
}