2018-03-11 09:39:46 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Amp\Dns\Test;
|
|
|
|
|
|
|
|
use Amp\Dns\Record;
|
|
|
|
use Amp\PHPUnit\TestCase;
|
|
|
|
|
2019-01-25 02:27:47 +01:00
|
|
|
class RecordTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testGetName()
|
|
|
|
{
|
2018-03-11 09:39:46 +01:00
|
|
|
$this->assertSame("A", Record::getName(Record::A));
|
|
|
|
}
|
|
|
|
|
2019-01-25 02:27:47 +01:00
|
|
|
public function testGetNameOnInvalidRecordType()
|
|
|
|
{
|
2018-03-11 09:39:46 +01:00
|
|
|
$this->expectException(\Error::class);
|
|
|
|
$this->expectExceptionMessage("65536 does not correspond to a valid record type (must be between 0 and 65535).");
|
|
|
|
|
|
|
|
Record::getName(65536);
|
|
|
|
}
|
|
|
|
|
2019-01-25 02:27:47 +01:00
|
|
|
public function testGetNameOnUnknownRecordType()
|
|
|
|
{
|
2018-03-11 09:39:46 +01:00
|
|
|
$this->assertSame("unknown (1000)", Record::getName(1000));
|
|
|
|
}
|
|
|
|
}
|