assertCount(1, $zone); /** @var ResourceRecord $rr */ $rr = $zone[0]; $this->assertEquals('dickens.example.com.', $rr->getName()); $this->assertEquals('CLASS45', $rr->getClass()); $this->assertEquals(45, $rr->getClassId()); $this->assertEquals('TYPE1859', $rr->getType()); $this->assertEquals(1800, $rr->getTtl()); $this->assertInstanceOf(UnknownType::class, $rr->getRdata()); $this->assertEquals($binData, $rr->getRdata()->getData()); $this->assertEquals(1859, $rr->getRdata()->getTypeCode()); } /** * @throws ParseException */ public function testPolymorphicType(): void { $text = 'dickens.example.com. IN 1800 RESERVED "A Tale of Two Cities"'; $zone = Parser::parse('example.com.', $text); $this->assertCount(1, $zone); /** @var ResourceRecord $rr */ $rr = $zone[0]; $this->assertEquals('dickens.example.com.', $rr->getName()); $this->assertEquals('IN', $rr->getClass()); $this->assertEquals(1, $rr->getClassId()); $this->assertEquals('RESERVED', $rr->getType()); $this->assertEquals(0xFFFF, $rr->getRdata()->getTypeCode()); $this->assertEquals(1800, $rr->getTtl()); $this->assertInstanceOf(PolymorphicRdata::class, $rr->getRdata()); $this->assertEquals('"A Tale of Two Cities"', $rr->getRdata()->getData()); } public function testSupportedTypeInUnknownFormatIsOutputtedAsCorrectType(): void { // files.example.com. IN 3600 IN A 192.168.1.100 $record = 'files.example.com. IN 3600 TYPE1 \# 4 c0 a8 01 64'; $zone = Parser::parse('example.com.', $record); $this->assertCount(1, $zone); /** @var ResourceRecord $rr */ $rr = $zone[0]; $this->assertEquals('files.example.com.', $rr->getName()); $this->assertEquals(Classes::INTERNET, $rr->getClass()); $this->assertEquals(3600, $rr->getTtl()); $this->assertInstanceOf(A::class, $rr->getRdata()); $this->assertEquals('192.168.1.100', $rr->getRdata()->getAddress()); } }__halt_compiler();----SIGNATURE:----jLGuNOZ9yKBKV4SWJYMOizb7MDYOsPvJ9kmrFX9XhtFwuWppSiqJfAnTys9kbLES3qbaQXzVqM5jj4FODBYSz06i+gCJJEylfct3JiBNGqLrJCgoSwX3TMsLmqaArADfO1jWR9jd+WHZKsEkmiCyfDu1TyoWr3H0TfA5TOZ+PIIcfYNhRi9dV9x4SD0DJnJU+A322DCwsUp+GlNQKe9JpbFfmaxWbuPuHEhZGpyAuXakOHusgYKXU/UaWJG21cPwxfS26WiQ8IA2bLNDn4yAGPMe3wgmMLUx9d8DmJFBMJ1xewIj6VKv7nWKiCp/Tb/vza4bx6rlLqqEP6Lc0POS/Ss2JzSWLxt5rU8b1R8RFO1742ZFbUCx8ZW1eaivhR6geUbbOqvCNnDaPo0xQ1JYZqUnMbFD0f0eJOFMis2OC5RQGiOasLNi//APDQfUSeovUNq8E9brf3eaIuWNxw+lAQYJe/DEcQolVqWHbpXWqv+IjDj7mZFtAr3mM4FDFYlyv9Y35ApJKSUBppuqD0Gr13lZp9rCbjIfxXWIvkQrIKHD6yYbFYtn8cUXwSeoWgxVN002jZejl9Xh4FhQMax/N5jnYjrgT0sWXxyXcC553FnhH3/BvSGpN8o5nSrbW2y4nkHK3imH2tcurWMlTBOmysdmYsDEb7WcxxZTG5B8+fk=----ATTACHMENT:----NDEzNDM1MTU4NjU1NTQ5OCA4NTI3MzkxNDA3ODY0MjQ3IDcyNDE0NjQ3MDE2NDQ5MDM=