setName('example.com.'); $q->setType('NS'); $q->setClass('IN'); $expectation = chr(7).'example'.chr(3).'com'.chr(0).pack('nn', 2, 1); $this->assertEquals($expectation, $q->toWire()); } public function testSetClassThrowsException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Invalid class: "65536".'); $q = new Question(); $q->setClassId(65536); } public function testSetNameThrowsException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('"abc123.com" is not a fully qualified domain name.'); $q = new Question(); $q->setName('abc123.com'); } public function testFromWire(): void { $wireFormat = chr(7).'example'.chr(3).'com'.chr(0).pack('nn', 2, 1); $q = Question::fromWire($wireFormat); $this->assertEquals('example.com.', $q->getName()); $this->assertEquals('NS', $q->getType()); $this->assertEquals('IN', $q->getClass()); } public function testSetTypeCodeThrowsException(): void { $this->expectException(\DomainException::class); $this->expectExceptionMessage('TypeCode must be an unsigned 16-bit integer. "65536" given.'); $q = new Question(); $q->setTypeCode(65536); } } __halt_compiler();----SIGNATURE:----QZwHigICH7YW1xgQROWR6y2QJLVPP4TzpTM3dZC57OcxsPGQrJN0he+geD+YWajuMBbnsFohwN53vXkE7NH/uyuTNAPXH9+jSe8O5sujAexi4nl4iTToDjCIyZfRSJNtrxt4fz1MLqTXVPXAZRFfL7Suh3rRw6QtwPOJPOz0mirQWqK5/Duv1tMBj8IniyBO1EWyF+nPZpsi1jzB55nJW3WRWkAiLIkdy1PTW9yMfxZTS4YTYDOmhCDPio8WX4/mYiuzSh1qjJAnuHm2Wt0JG/jZcZRHmQjgMe6m0HNpMj0Vp9maSOdR+jztZ9wilGawvR3F85Co7uGRO0wbwPy7amnz3rMq7IJde2j8WBFn/XhBWXrYOIwwXKAg/p1B++e8gSHDk+zSkdSSrOkNM9vXaNt5/3nOoY1BM3ONqo/aRG7acCGM7Oy/gWqcvernxyxgCxdnAbMN6ktO6QPa4aLHPWLMjLDXtkYYL/2YXnT5eGHNcv9tm6oni4L3fnqwvSpup6UxkTfqbFAYEBRBrkzGwC/5mGP5BtfpMXJcKnTOxW+tCyPCevp/P5x/C4bja9zT8OkVOTEdmzMn1rGbATB3n/vARlwDNMil3ghdz5z7zwHwcMIivMDbYF2DUHQDC2ay7GUhLVzV7DVrFCvRNfp4YUx06oUyUzhbW3iXzXxco6k=----ATTACHMENT:----NjU2NzM4NzIwNTUzNDE1MSA1MzU1NjA2MzY4NDMwMTQ2IDg4NjQyNDU1MDcyMjA2MzM=