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:----XI0ybnhTHLuMPBIT+shm2tQKkAjiQQqRmN1/uDvnEKCtkDAIBsUZxQ1p7dPz0tGjpCNngxj7o+IqEVsBK7DIStbDJtT1PGQIb4xbh1qoZhqKrQZaI7S/P0pXje7GOyAqAKcyz/OsNPuRozL+OXERXaQMDvB/DmOwU1/lqumV76IlXVSPFza+GBIwpPvPYnObyLoGe7usAko4cfgpsKPUYsnpe3co6v2QBzrkJ+BcihWa09oSZtw37oJZs5+jVPkFG1pKMKsACvJQsr45gA+stskkDsJbmD7thl84pRFc+jFWardQ37QiOp7RJtsFUgekL29VOZU8PmZzNkWcr+rlDn9CQv0UvsgotbuTYYs5i2zLSyJnrQU/sNsaXmgyMWuYREKLv9Kd00ISyhYS1INvKM0TyGTVmBnTk2LB7tt4Xrrtyh/gUH+VvWIP5EPYiaTg1fWl8fZRCCtNUmTzLP/taOC+QXFgTy7kP+++g6ftqHcQinXMNIbAhNOmwicqOB/HaMISA3W/TEs7vMouvLo2hLEFKChoNo/qA1N5B3r+aupyVklgvCPL4zuqir33Xb0ysGDokESR6+hefNq0MYlZvc6g743cu0sgZM65JB4/2vG/wH/XntZGevHNzbgrKV+I40DRpVX4gSnFy7FY6pT4dZAFey67qGBGkg/BaB5I158=----ATTACHMENT:----OTg2NzA2MjcxOTY3MTE3NSA0NDU4NDA3NTkyODcwMjc4IDY3MjAyMDk4NjE2MTczMjY=