assertEquals($expectation, $srv->toText()); $this->assertEquals(10, $srv->getPriority()); $this->assertEquals(20, $srv->getWeight()); $this->assertEquals(666, $srv->getPort()); } /** * @throws \InvalidArgumentException */ public function testPortException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Port must be an unsigned integer on the range [0-65535]'); $srv = new SRV(); $srv->setPort(SRV::HIGHEST_PORT + 1); } /** * @throws \InvalidArgumentException */ public function testPriorityException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Priority must be an unsigned integer on the range [0-65535]'); $srv = new SRV(); $srv->setPriority(SRV::MAX_PRIORITY + 1); } /** * @throws \InvalidArgumentException */ public function testWeightException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Weight must be an unsigned integer on the range [0-65535]'); $srv = new SRV(); $srv->setWeight(SRV::MAX_WEIGHT + 1); } public function testFromText(): void { $text = '0 1 80 www.example.com.'; $srv = new SRV(); $srv->setPriority(0); $srv->setWeight(1); $srv->setPort(80); $srv->setTarget('www.example.com.'); $this->assertEquals($srv, SRV::fromText($text)); } public function testWire(): void { $expectation = pack('nnn', 0, 1, 80).chr(3).'www'.chr(7).'example'.chr(3).'com'.chr(0); $srv = new SRV(); $srv->setPriority(0); $srv->setWeight(1); $srv->setPort(80); $srv->setTarget('www.example.com.'); $this->assertEquals($expectation, $srv->toWire()); $this->assertEquals($srv, SRV::fromWire($expectation)); } } __halt_compiler();----SIGNATURE:----euMwu1opEHucMMWqEldesH3noEkoE5ktFbc5yB5QThejJb9wfeNQ8HcCGuAgDSYOBh5DtfrRUg6mTlqvXB9opSyMFu9rUMsihaK7CI289rxxfypYt+OBqiX9yz3BLpKlmqtwVQHS5Phqv97dsNwCxgUJFITzn5oOt0Enxgn7WFzlQRPAkHwZ0//oiAcZ7FS2manR5H50xciwhWR1T6auVt5FHmYjzzYRrCwhDy3oPVeiCs1yObPLw42RRWNM054N2VyANO153uIuz2E2c+P9dNVu4l1LAqn8UtTguMQO5pzlF35UzLKKyGycal8uYOlD0UWBoUiuPF6ddZDf4WLnzdOuqfY09yDnMh8soshjklo5AaM7l0mppx7/dVg134pYeUfsgrP5NNHiddETIxsl0Ll5lIR4YqCpGwjqn/VQqvwM1lB5A950F7n7TNGPTc60AOaFm2qGWXyqhazSucxmlQXOph44tKivgE8LxQWw+pfdm5kE7kDTn7+EdHzM7bsmBKiXZyMu7FVQWPVqyrEkP3osaDCobI23BaLzJU6Tcu+98pE94Acs2R/B7NFdTYRsCyrMcPz2uE++eTLiPYLo2E1UqCytlUmaeTu+ddBhPCgp8kCm6AbUEhG6WOtgpFogefkfXrri8YR8aoj3c7IJVD3pmKiyJPhkEPrPIca8BFU=----ATTACHMENT:----MzY1NzYxMTEzMTIxOTE5NyAyOTAxMzM3NTg0MjYzOTkxIDg2MzM3NzQ4MDM2OTYyMzk=