49 lines
1.8 KiB
PHP
49 lines
1.8 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Tests\Doubles;
|
||
|
|
|
||
|
|
use App\Services\Autopodbor\Agent\CompetitorAgent;
|
||
|
|
use App\Services\Autopodbor\Agent\Dto\FindCompetitorsRequest;
|
||
|
|
use App\Services\Autopodbor\Agent\Dto\FindCompetitorsResult;
|
||
|
|
use App\Services\Autopodbor\Agent\Dto\ResolveByNameRequest;
|
||
|
|
use App\Services\Autopodbor\Agent\Dto\ResolveByNameResult;
|
||
|
|
use App\Services\Autopodbor\Agent\Dto\StudyCompetitorRequest;
|
||
|
|
use App\Services\Autopodbor\Agent\Dto\StudyCompetitorResult;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Тест-дубль: возвращает один телефон с богатым «где нашли»
|
||
|
|
* (список мест + офис + число подтверждений) — для проверки провода до БД и API.
|
||
|
|
*/
|
||
|
|
final class RichCompetitorAgent implements CompetitorAgent
|
||
|
|
{
|
||
|
|
public function findCompetitors(FindCompetitorsRequest $r): FindCompetitorsResult
|
||
|
|
{
|
||
|
|
return new FindCompetitorsResult([]);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function studyCompetitor(StudyCompetitorRequest $r): StudyCompetitorResult
|
||
|
|
{
|
||
|
|
return new StudyCompetitorResult([
|
||
|
|
[
|
||
|
|
'signal_type' => 'call',
|
||
|
|
'identifier' => '73912920000',
|
||
|
|
'phone_kind' => 'real',
|
||
|
|
'phone_type' => 'city',
|
||
|
|
'provenance_url' => 'https://k.ru',
|
||
|
|
'provenance_label' => 'в коде сайта',
|
||
|
|
'where_found' => [
|
||
|
|
['label' => 'в коде сайта', 'url' => 'https://k.ru'],
|
||
|
|
['label' => '2ГИС · ул. Весны 7а', 'url' => 'https://2gis.ru/firm/1'],
|
||
|
|
],
|
||
|
|
'office' => 'Единая справочная',
|
||
|
|
'confirmations' => 2,
|
||
|
|
],
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function resolveByName(ResolveByNameRequest $r): ResolveByNameResult
|
||
|
|
{
|
||
|
|
return new ResolveByNameResult([]);
|
||
|
|
}
|
||
|
|
}
|