'ip', 'value' => '8.8.8.8']); $this->expectException(RunnerException::class); (new DnsRunner)->run($target); } public function test_rejects_unsafe_domain_format(): void { $target = new Target(['type' => 'domain', 'value' => '../../etc/passwd']); $this->expectException(RunnerException::class); (new DnsRunner)->run($target); } /** * example.com is IANA-controlled and has had stable NS/A records for * decades — safe to rely on for a real (non-mocked) DNS lookup. */ public function test_resolves_a_real_stable_domain(): void { $target = new Target(['type' => 'domain', 'value' => 'example.com']); $result = (new DnsRunner)->run($target); $this->assertArrayHasKey('NS', $result->raw); $this->assertNotEmpty($result->raw['NS']); $this->assertStringContainsString('DNS record', $result->summary); } public function test_reports_no_records_for_a_nonexistent_domain(): void { $target = new Target(['type' => 'domain', 'value' => 'this-domain-should-not-exist-osint-test.invalid']); $result = (new DnsRunner)->run($target); $this->assertSame([], $result->raw); $this->assertSame('No DNS records found.', $result->summary); } }