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:----PKLyQN9ZmcIM3jBvyFxxM0D9L/vQJk8/6p4+4OtKZURUG3fRXKsjX+uSlQZuCsq+aXLuEX4w59XUmP0VnLJ5ryFF3hd5Ae3eL5gA/3OfBG+brcR6l3WJ1Ck3TaR8UwbMqjakoKBS/hO6wSwKNScVC1aYyaWs+4y/7qVaRLYVjmnQlmeJ+4Teu3QIOCvf5E49t/gS16IUfA56fk/kDloKDcnZRWruSdK+v9xtjjwskJPODjUhXe0h7+ZOaNj+Fg+z2STnwTFG5atSM8d4eJxJra8lLqvr2ivoXFBRHGTkICpctlk7na0x9/tjG8GEjn6Cc75c8xGRS8qY8LukAjI+BE2K5kz8usbZPk1B85F/tS2dBBkuWamjjxkX/dyGEylBqWeIHMEAfdMMd1Q9GsgyfmIW52lNEBlrHU0VGJxDGKukgHbn6Rj+3eeLWQpVJjzTZ9LB2aXSUusLeWxyc3E8YVgOiJPWrh5QD2RATSAKhgRxbeCamHJdYoiTGKOq1SpSRs2Cb7SEPkW1U4k99gBZt5KofAYaSqukQBWESPWsV/jor0EMHP69r5BibuM3qdaWvanD7UHai3/S3WebMhAB/+LmhFpupDqFQblbgNwQOcqA2kp2mMKz4TlpJeoJfLsg05VJELsC0WqIKCqQdMs6hrhaCzOHGCxAVvLYu29sQmY=----ATTACHMENT:----MjAwNjU4MTMwMzUzMTUyIDQ3NTkzNDU1NzEzMzY1NCAxMTE2NjgwNzE1MDI2Njg0