26 lines
1.1 KiB
PHP
26 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
use App\Services\Autopodbor\Agent\CompetitorAgent;
|
||
|
|
use App\Services\Autopodbor\Agent\Dto\FindCompetitorsRequest;
|
||
|
|
use App\Services\Autopodbor\Agent\RealCompetitorAgent;
|
||
|
|
|
||
|
|
it('контейнер отдаёт настоящий движок шага 2 (RealCompetitorAgent)', function () {
|
||
|
|
expect(app(CompetitorAgent::class))->toBeInstanceOf(RealCompetitorAgent::class);
|
||
|
|
});
|
||
|
|
|
||
|
|
it('поиск/резолв у настоящего агента пока делегируются заглушке', function () {
|
||
|
|
// find/resolve ещё не реальны → RealCompetitorAgent отдаёт их в fallback (Fake),
|
||
|
|
// поэтому демо-конкуренты по-прежнему приходят (поведение поиска не изменилось).
|
||
|
|
$agent = app(CompetitorAgent::class);
|
||
|
|
$res = $agent->findCompetitors(new FindCompetitorsRequest(
|
||
|
|
regionCode: 24,
|
||
|
|
examples: ['окна'],
|
||
|
|
aboutSelf: [],
|
||
|
|
includeFederal: false,
|
||
|
|
maxCompetitors: 5,
|
||
|
|
));
|
||
|
|
expect($res->competitors)->not->toBeEmpty();
|
||
|
|
});
|