Http::response('', 200)]); $target = new Target(['type' => 'email', 'value' => 'test@example.com']); $result = (new GravatarRunner)->run($target); $this->assertTrue($result->raw['has_avatar']); $this->assertNotNull($result->raw['avatar_url']); $this->assertStringContainsString('Gravatar image found', $result->summary); } public function test_reports_no_avatar(): void { Http::fake(['gravatar.com/avatar/*' => Http::response('', 404)]); $target = new Target(['type' => 'email', 'value' => 'test@example.com']); $result = (new GravatarRunner)->run($target); $this->assertFalse($result->raw['has_avatar']); $this->assertNull($result->raw['avatar_url']); $this->assertSame('No Gravatar found for this email.', $result->summary); } public function test_rejects_non_email_targets(): void { $target = new Target(['type' => 'domain', 'value' => 'example.com']); $this->expectException(RunnerException::class); (new GravatarRunner)->run($target); } public function test_rejects_invalid_email_format(): void { $target = new Target(['type' => 'email', 'value' => 'not-an-email']); $this->expectException(RunnerException::class); (new GravatarRunner)->run($target); } public function test_throws_on_unexpected_status(): void { Http::fake(['gravatar.com/avatar/*' => Http::response('', 500)]); $target = new Target(['type' => 'email', 'value' => 'test@example.com']); $this->expectException(RunnerException::class); (new GravatarRunner)->run($target); } }