setMname($mname); $soa->setRname($rname); $soa->setSerial($serial); $soa->setRefresh($refresh); $soa->setRetry($retry); $soa->setExpire($expire); $soa->setMinimum($minimum); $this->assertEquals($mname, $soa->getMname()); $this->assertEquals($rname, $soa->getRname()); $this->assertEquals($serial, $soa->getSerial()); $this->assertEquals($refresh, $soa->getRefresh()); $this->assertEquals($retry, $soa->getRetry()); $this->assertEquals($expire, $soa->getExpire()); $this->assertEquals($minimum, $soa->getMinimum()); } public function testOutput(): void { $soa = Factory::SOA( 'example.com.', 'postmaster.example.com.', 2015042101, 3600, 14400, 604800, 3600 ); $expected = 'example.com. postmaster.example.com. 2015042101 3600 14400 604800 3600'; $this->assertEquals($expected, $soa->toText()); $this->assertEquals($expected, $soa->toText()); } public function testFromText(): void { $text = 'example.com. post.example.com. 2015042101 3600 14400 604800 3600'; $mname = 'example.com.'; $rname = 'post.example.com.'; $serial = 2015042101; $refresh = 3600; $retry = 14400; $expire = 604800; $minimum = 3600; $soa = SOA::fromText($text); $this->assertEquals($mname, $soa->getMname()); $this->assertEquals($rname, $soa->getRname()); $this->assertEquals($serial, $soa->getSerial()); $this->assertEquals($refresh, $soa->getRefresh()); $this->assertEquals($retry, $soa->getRetry()); $this->assertEquals($expire, $soa->getExpire()); $this->assertEquals($minimum, $soa->getMinimum()); } public function testWire(): void { $soa = new SOA(); $mname = 'example.com.'; $rname = 'post.example.com.'; $serial = 1970010101; $refresh = 3600; $retry = 14400; $expire = 604800; $minimum = 3600; $soa->setMname($mname); $soa->setRname($rname); $soa->setSerial($serial); $soa->setRefresh($refresh); $soa->setRetry($retry); $soa->setExpire($expire); $soa->setMinimum($minimum); $wireFormat = chr(7).'example'.chr(3).'com'."\0". chr(4).'post'.chr(7).'example'.chr(3).'com'."\0". pack('NNNNN', 1970010101, 3600, 14400, 604800, 3600); $this->assertEquals($wireFormat, $soa->toWire()); $rdLength = strlen($wireFormat); $wireFormat = 'abcde'.$wireFormat; $offset = 5; $this->assertEquals($soa, SOA::fromWire($wireFormat, $offset, $rdLength)); $this->assertEquals(5 + $rdLength, $offset); } } __halt_compiler();----SIGNATURE:----CMrNoKhzk2J8GBJHD8L1ZN0quTuS924wtedV/uch140ZnX51kvePIRuMK8P0N7Tq+NKkyAS1o1KeVmk6v1vjBAb187oZAczejfboCeoJDwYoDBxO6ZO+1Tw25NjFwyJF8L6eOJOVGlxCPt+ISrCSKjleSQrib8uVM89DfAhPC/g2ud9ZwP4ogK5xBiXQ0SeWa+r/yzj5nanuoImKEFMvIX0qk5oPJPV7T8se8l0zJeR30KFtblqtd/fkfWeoiuGCeJBNw5ARaRNmz0D7X5m0vZrS6HHfCTIG7q9oLNz2XuJ8vzApWi53UyVgmlV23P2twZJI08WB6undszIYP16h1OCbX6nAhyj1c09reIVb6A0x9VkRTe5Tl48VEFSZc1UsLbR5RpombTdMEDtIXTFoP2To/UAjURut3C4Bd3w2AVecwYinCF2zJLpNSvZMya+usaUKribYAvF8fJNJcFeLwxzVg59F1UHYqw6iaryi4EQPJ5ejw95u93NubDy+wEL3r+76xRitIK8i1Kb2ZYFYHkVW7a23HebKJXoM3POYdA1ZnFDJ2eZQ5u2Cc0dcIsJB3HxU5gusMqJoKEoIxJgOH3PUkDI1JRQuLGRx4/YmGjGUMYFVn7ab5Dp8ePEM9wbyZ9F2BgpkX/eSja+h0ehR+R6iZloHeM988osOOn8OWnw=----ATTACHMENT:----MjM5NDQ4Mzc4MzUwNzEwMiA2MDIyODc0MzE4MTU3MTQ0IDIxNDA5NTg5MTI2NDkzNTU=