9ff837bdb9
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
20 lines
842 B
PHP
20 lines
842 B
PHP
<?php
|
|
|
|
use App\Services\Autopodbor\Agent\Study\SiteOpener;
|
|
use App\Services\Autopodbor\Agent\Fetch\Fetcher;
|
|
use App\Services\Autopodbor\Agent\Fetch\FetchedSite;
|
|
|
|
it('вскрывает сайт: номер из tel: → kind code, попадает в codeDigits', function () {
|
|
$fake = new class implements Fetcher {
|
|
public function site(string $url): FetchedSite {
|
|
return new FetchedSite($url, '<a href="tel:+73912920000">звонок</a>');
|
|
}
|
|
public function directory(string $url): array { return []; }
|
|
};
|
|
$r = (new SiteOpener($fake))->open('kraslombard24.ru', '391');
|
|
expect($r->ok)->toBeTrue()
|
|
->and($r->codeDigits)->toContain('73912920000')
|
|
->and(collect($r->numbers)->pluck('kind'))->toContain('code')
|
|
->and($r->htmlLower)->toContain('tel:+73912920000');
|
|
});
|