assertCount(2, $nsRecords); $mailTxtRecords = ParserTest::findRecord('mail', $zone, TXT::TYPE); $this->assertCount(1, $mailTxtRecords); $this->assertNull($mailTxtRecords[0]->getComment()); $sub_domainRecords = ParserTest::findRecord('sub.domain', $zone, A::TYPE); $this->assertCount(1, $sub_domainRecords); $this->assertEquals('This is a local ip.', $sub_domainRecords[0]->getComment()); $ipv6_domainRecords = ParserTest::findRecord('ipv6.domain', $zone, AAAA::TYPE); $this->assertCount(1, $ipv6_domainRecords); $this->assertEquals('This is an IPv6 domain.', $ipv6_domainRecords[0]->getComment()); $soaRecords = ParserTest::findRecord('@', $zone, SOA::TYPE); $this->assertCount(1, $soaRecords); $this->assertEquals('MNAME RNAME SERIAL REFRESH RETRY EXPIRE MINIMUM This is my Start of Authority Record; AKA SOA.', $soaRecords[0]->getComment()); } /** * @throws \Exception */ public function testCommentOnlyLinesParse(): void { $zoneFile = NormaliserTest::readFile(__DIR__.'/Resources/testCollapseMultilines_sample.txt'); $zone = Parser::parse('example.com.', $zoneFile, Comments::ALL); $nullEntries = ParserTest::findRecord(null, $zone, null); $this->assertCount(4, $nullEntries); $this->assertEquals('NS RECORDS', $nullEntries[0]->getComment()); $this->assertEquals('A RECORDS', $nullEntries[1]->getComment()); $this->assertEquals('AAAA RECORDS', $nullEntries[2]->getComment()); $this->assertEquals('MX RECORDS', $nullEntries[3]->getComment()); } /** * @throws \Exception */ public function testMultilineTxtRecords(): void { $zoneFile = NormaliserTest::readFile(__DIR__.'/Resources/testMultilineTxtRecords_sample.txt'); $zone = Parser::parse('acme.com.', $zoneFile, Comments::ALL); $txtRecords = ParserTest::findRecord('test', $zone, TXT::TYPE); $this->assertCount(1, $txtRecords); $test = $txtRecords[0]; $this->assertEquals('test', $test->getName()); $this->assertEquals(7230, $test->getTtl()); $this->assertEquals('TXT', $test->getType()); $this->assertEquals('This is a comment.', $test->getComment()); $this->assertEquals('This is an example of a multiline TXT record.', $test->getRdata()->getText()); } }__halt_compiler();----SIGNATURE:----v/B7KeAs/tubJ3PqNtBg1NS/ptgq48ZYahArU0o0gKRuQ+EkL1ZMi22OnLNP6bUIi/yyd/YpPP29e5icPOHw7D8sv+wp1Vk2Y0yFpYHk2CXS3gpPcVkh+0C1eQ3daPSigqoZQOTENqvGcfFrqISolLz0t0rPSdgGF16RLnUfSzva7MAF4pp3KE/poZfzzavf+rLMcADglwoWkYYvbTGq1fQfUDrYtmWpehNzaXvJKDYEaX16Zyxomp1inW0uQFDMunqZP353HqN13c/7+ihzIzBERHy3Vm3KrPtkMlEiN56DdCl065xTBvyH4Hk7Z8yHbv5RAIQPFRC8wqIWBuUkhIDrewEURCeSV3eHW3JkX8QcpShto7LF9WDs4WYH7H2pCLqYaXTJw4qR9ddY7Yp3k4ltTrKjbV5iArUh6L3VJ72I9k0dG5OOuJ11i1rnK/ts3Pean1IHlHEtT/Y73BdPWIvubmBjG2IyNiz1uy4X6CK3jmqn+M5KhRCEpD+6Egmqhf6kF/IhyOAD53wRDTLdF4156JCiRVm6YQPPd44/VuGxLSz62fVfZMJXRqw/dWf1KeM8xtljKOWTZtB2Mi2ECU2TkDkDI7t51njm3ilAzaH1f6RJ47+F+8dQ3K7tN2IvLe0WmLIlDz2B7x3bTHRbMEH97EMhkA8967Wv9UnoZIM=----ATTACHMENT:----OTk5MDc4MTg4MzQ1NzgxMSA4NjY2NDUxNzM4MDQ1MTY4IDY1OTYzMzM3MDkwMTU2OTE=