mirror of
https://github.com/danog/dns.git
synced 2024-12-02 09:27:55 +01:00
28 lines
625 B
PHP
28 lines
625 B
PHP
<?php
|
|
|
|
namespace Amp\Dns\Test;
|
|
|
|
use Amp\Dns\Record;
|
|
use Amp\PHPUnit\TestCase;
|
|
|
|
class RecordTest extends TestCase
|
|
{
|
|
public function testGetName()
|
|
{
|
|
$this->assertSame("A", Record::getName(Record::A));
|
|
}
|
|
|
|
public function testGetNameOnInvalidRecordType()
|
|
{
|
|
$this->expectException(\Error::class);
|
|
$this->expectExceptionMessage("65536 does not correspond to a valid record type (must be between 0 and 65535).");
|
|
|
|
Record::getName(65536);
|
|
}
|
|
|
|
public function testGetNameOnUnknownRecordType()
|
|
{
|
|
$this->assertSame("unknown (1000)", Record::getName(1000));
|
|
}
|
|
}
|