chore: initial import for test contour
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user