create([ 'domain' => 'jabali-panel.com', 'ip_address' => null, 'ipv6_address' => null, ]); }); $this->assertNotNull($domain); $service = new MigrationDnsSyncService($this->createMock(AgentClient::class)); $method = new ReflectionMethod($service, 'getDefaultRecords'); $method->setAccessible(true); $records = $method->invoke($service, $domain); $this->assertTrue($this->recordExists($records, 'ns1', 'A', '182.54.236.100')); $this->assertTrue($this->recordExists($records, 'ns2', 'A', '182.54.236.100')); $this->assertTrue($this->recordExists($records, 'ns1', 'AAAA', '2001:db8::1')); $this->assertTrue($this->recordExists($records, 'ns2', 'AAAA', '2001:db8::1')); } /** * @param array> $records */ private function recordExists(array $records, string $name, string $type, string $content): bool { foreach ($records as $record) { if (($record['name'] ?? null) !== $name) { continue; } if (($record['type'] ?? null) !== $type) { continue; } if (($record['content'] ?? null) !== $content) { continue; } return true; } return false; } }