mirror of
https://github.com/danog/dns.git
synced 2024-11-30 04:29:06 +01:00
24 lines
613 B
PHP
24 lines
613 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));
|
||
|
}
|
||
|
}
|