1
0
mirror of https://github.com/danog/dns.git synced 2025-01-22 21:41:11 +01:00
dns/test/RecordTest.php
2023-01-09 23:33:46 +01:00

28 lines
691 B
PHP

<?php declare(strict_types=1);
namespace Amp\Dns\Test;
use Amp\Dns\DnsRecord;
use Amp\PHPUnit\AsyncTestCase;
class RecordTest extends AsyncTestCase
{
public function testGetName(): void
{
self::assertSame("A", DnsRecord::getName(DnsRecord::A));
}
public function testGetNameOnInvalidRecordType(): void
{
$this->expectException(\Error::class);
$this->expectExceptionMessage("65536 does not correspond to a valid record type (must be between 0 and 65535).");
DnsRecord::getName(65536);
}
public function testGetNameOnUnknownRecordType(): void
{
self::assertSame("unknown (1000)", DnsRecord::getName(1000));
}
}