Http::response('', 200)]); $feed = Feed::factory()->create([ 'type' => 'website', 'url' => 'https://no-parser-for-this-domain.example/', ]); $this->assertEmpty($this->action()->execute($feed)); $this->assertSame(0, Article::count()); } public function test_it_returns_empty_when_the_fetch_throws(): void { Http::fake(fn () => throw new \RuntimeException('connection refused')); $feed = Feed::factory()->create([ 'type' => 'website', 'url' => 'https://www.vrt.be/vrtnws/nl/', ]); $this->assertEmpty($this->action()->execute($feed)); } public function test_it_returns_a_collection_for_a_feed_with_a_parser(): void { Http::fake([ 'https://www.vrt.be/vrtnws/nl/' => Http::response('Sample VRT content', 200), ]); $feed = Feed::factory()->create([ 'type' => 'website', 'url' => 'https://www.vrt.be/vrtnws/nl/', ]); $this->assertInstanceOf(Collection::class, $this->action()->execute($feed)); } }