assertEquals($expectation, $srv->toText()); $this->assertEquals(10, $srv->getPriority()); $this->assertEquals(1, $srv->getWeight()); $this->assertEquals('http://www.example.com/path', $srv->getTarget()); } /** * @dataProvider dataProvider_testExceptions */ public function testExceptions( int $priority, int $weight, string $target, string $expectedException, string $expectedExceptionMessage, ): void { $this->expectException($expectedException); $this->expectExceptionMessage($expectedExceptionMessage); Factory::URI($priority, $weight, $target); } public function testFromText(): void { $text = '10 1 "ftp://ftp1.example.com/public%20data"'; $uri = new URI(); $uri->setPriority(10); $uri->setWeight(1); $uri->setTarget('ftp://ftp1.example.com/public%20data'); $fromText = new URI(); $fromText->fromText($text); $this->assertEquals($uri, $fromText); } public function testWire(): void { $wireFormat = pack('nn', 10, 1).'ftp://ftp1.example.com/public%20data'; $uri = new URI(); $uri->setPriority(10); $uri->setWeight(1); $uri->setTarget('ftp://ftp1.example.com/public%20data'); $this->assertEquals($wireFormat, $uri->toWire()); $fromWire = new URI(); $fromWire->fromWire($wireFormat); $this->assertEquals($uri, $fromWire); $rdLength = strlen($wireFormat); $wireFormat = 'abc'.$wireFormat; $offset = 3; $fromWire = new URI(); $fromWire->fromWire($wireFormat, $offset, $rdLength); $this->assertEquals($uri, $fromWire); $this->assertEquals(3 + $rdLength, $offset); } }__halt_compiler();----SIGNATURE:----Mn7qIV+3w3d/1Ov56H3iRcJCqPCW5HX0qcXN0dZsS6ehgxdY3aEuUg6IwEH5m/5k7BV2pfo4WBe0EUcK3InmFewTd7kJRIpNWl023QHHiRBREa4Yb3nLkkAt8pFzKZQlimEXPMNLHojka7ay44t5zz0jnn8cR1oMfLkDKMcS3VFBhZ0joxsGZo+8BNP/wujouOvgKwWkJh7EmbQ8H6ijDEboDuRQ6TSCgcOB41E2Qfj+0RnKBT0DHCCemuDhFyWW3ZCxttuo8HVi3PbwiuwCbbcykojP6Fzd61H5gl/44jLWBS7xhqL+Qqgwb9Dceslimsyxed09Dm9fBy1Ef1yy/FJSJ0G5BqyHj1naISJ1Kh1QT1WXxJSLM4pLc0BmV9FK+7JriCZtxXa16fxhwBLjXqiks/munvbXd9hAGkB327PglknWLV9dMF59I+LsCCG4U9C8PJJ0bv8SCmnyEFyH7kdi3/c7u+q+E27kKYJ3X8clASO0vjs7f0NNZdqn3dsM/luqHaJXBpkQ23TSf3wyEkPflucKo1DeJtAF0k43Bwg5gOjMf5rlMSNGGvlJN2+OTVOITwCi7snAXFwVWL3/qSy4fnatZchAdT3alXxCL0gGU7e612SOP3NpnUAehWG7NOn2OE8ubT0EifrqAWsYgsRArNCpuWRw/6IRJ1xKMdg=----ATTACHMENT:----MTk4ODQxNjA2MjM3MTk1MiA2MTM4MjQxMDg2ODQwMjIwIDI4MjcxNTI2NTAwNDU4ODE=