Http::response('Rate exceeded.', 200), 'arxiv.org/list/cs/new*' => Http::response($this->sampleListHtml(), 200), ]); $enricher = $this->createMock(ArxivAbsEnricher::class); $enricher->method('enrichMany')->willReturnCallback(fn (array $items) => $items); $adapter = new ArxivApiAdapter( new ArxivRequestGate(0), $enricher, ); $source = new CrawlSource([ 'adapter_code' => 'arxiv_api', 'target_type' => 'paper', ]); $items = $adapter->fetch('https://arxiv.org/list/cs/new', $source, [ 'max_results' => 5, 'max_pages' => 1, 'skip_imported' => false, ]); $this->assertCount(2, $items); $this->assertSame('arxiv:2606.23690', $items[0]->externalId); $this->assertSame('Sample CS Paper One', $items[0]->title); $this->assertSame('list_html', $items[0]->extra['source']); } protected function sampleListHtml(): string { return <<<'HTML'