46 lines
1.0 KiB
PHP
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);
|
|
}
|
|
}
|