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:----nfgn4xRJjsSnhrk5oF8tvtPiqwFuBeLcI6zi64BxL4ybr8QIb2scUT9s0af4t5+p8tJBVNbnAO5AUZdt2y+TvYv9vi7ts4NGMEyJZooZNomE+ql5aiKRdDkNnsu0I2dKDsFThmVrH/8bf6bqHGZRPt7itfiHVnJGQI1ecRoa6onii9I/7u6KQOXtTV55niZMIxuQ1SgUaTinbYLSATxEPjIFGEtHO2/83/xZkJh4hye7Lu0zO+OyGsMwKwgdgXEiqtVGOlVE9zCzKjLemp94EBczGKNpsqWYqvtem6xzxpmSq0l1c4E1TEuv7C724uHP1Mt0IWmSCZOYmuS0pbtlV7m5gKaZfnK0uZV/bSpk1uc+sm1nB9NnNOEBI35B5rtPztGDJWvkg6r4ljS3QN/Uf/TeWK28IvAUtXxkHAGHgqIziVj6OFJjWnFB6Yvi1BDfP63jZ1LnzCGmeAZOeBXzJiVWp0B4FlFBlZRT3ZPtoHr6XFPY5DU41tyalVca/nktw9eHTPgbuOcuCU0/dnHjoyfsvm25JG5vVM5MndimZ/25PPaCZEacENeonVx9lbqhj+l7Yb5PbFW6jCU7plG72p5yOgT7ccCyKhKhb9PEioh/XY85rkTdUoxTeXp1lr6XqqL06f0pdhebKUyhyH0Oahzj8Iq6aowUe6Tsd7bbAUI=----ATTACHMENT:----ODQyNTA4MzYxMTg5MTY4OSA4NTU2NDczMzgzODcwMDQ5IDUxMzE5NTE0NDI4MTMyMjA=