Refactor mockRecord method to support string input.

This commit is contained in:
netkas 2025-01-10 13:34:18 -05:00
parent 36a2d52041
commit 2c83604057

View file

@ -127,8 +127,13 @@
* @param DnsRecord $record The DNS record to be associated with the specified domain. * @param DnsRecord $record The DNS record to be associated with the specified domain.
* @return void * @return void
*/ */
public static function mockRecord(string $domain, DnsRecord $record): void public static function addMock(string $domain, DnsRecord|string $record): void
{ {
if(is_string($record))
{
$record = DnsHelper::parseTxt($record);
}
self::$mockedRecords[$domain] = $record; self::$mockedRecords[$domain] = $record;
} }