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

58 lines
1.7 KiB
PHP

<?php
namespace Tests\Service;
use App\Dto\CalltouchCreateRequestDto;
use App\Service\Client\CalltouchClientService;
use PHPUnit\Framework\TestCase;
class CalltouchClientServiceTest extends TestCase
{
private CalltouchClientService $service;
private CalltouchCreateRequestDto $dto;
protected function setUp(): void
{
$this->dto = new CalltouchCreateRequestDto();
$this->dto->regionId = 91;
$this->dto->requestNumber = 'test_' . time();
$this->dto->subject = 'Тестовая заявка';
$this->dto->requestUrl = 'CalltouchClientServiceTest';
$this->dto->sessionId = null;
$this->dto->phoneNumber = '79996243200';
$this->dto->email = 'yahve1989@yandex.ru';
$this->dto->fio = 'Тест Public API';
$this->dto->addTags = ['public_api'];
$this->dto->requestDate = date('Y-m-d');
$this->dto->customSources = [
'source' => '',
'medium' => '',
'campaign' => '',
'term' => ''
];
$ctUrl = $_ENV['CT_URL'];
$apiClient = $_ENV['API_CLIENT'];
$params = $_ENV['CT_PARAMS'];
$this->service = new CalltouchClientService($apiClient, $ctUrl , $params);
}
public function testSend(): void
{
# -- 17 числа узнать документы
$response = $this->service->requestCreate($this->dto);
var_dump($response, $this->dto);
die();
// $plaintext = 'Hello, world!';
// $encrypted = $this->service->encrypt($plaintext);
// $decrypted = $this->service->decrypt($encrypted);
// $this->assertNotEquals($plaintext, $encrypted);
// $this->assertEquals($plaintext, $decrypted);
}
}