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:----iPRgMF4BDrxA/rObxXbwVxBdXRmMmsgtlLIZJSOvPVwDMBjuc0ds8aL/UBHhLOAtElUrcydRPg+0TlI3oCxLClzb5SiWIwgXj7Kfb9z+GBJB+ggRrzBwUEfQzKpu6EUyNPeT7O7NI7AqO2XefXzttXX1m7idGxHQm1HRyWjNU+P4SjE24jsIGN20v9TWkvvGQdYhGOgDOt/SACFhonKQDxdCr3/2+NKARX/rydt9WbpbkUUrfskW9z3BYVJtw8c0gBg9ubxmy+DwUgthbwTfQb7kPRUbWHWBLZ9djKh9Cqy75g03DDPVQxwfuUzTGSU7SncFk2oH8QO/OEnNYMyakc2BS/fIiOQuWKtpq730WjZ2mdaen3yyFDjfTP6ybAC0oFPaQZYpu8iC8mXlvkp97n9qRy4BehlwhShEuOicg3mEFPkfnsET9zz5cCFVGYCk9mGb5wderT/VBC7DsyUPzhDbPFxU27Rd4D68sBbIOUX6f+NdS26/2zSbvT/Ff+HU7lKk6cLmc7KrPf3AZV21kURS+2jwQQFoYWzSqkES98I4cPscjIoy3cf1gtjKhN6354KG2agNP7xdd43tIiA0br1hAMMX9nqJmTXPyaLvLvcMLlj1cJoOBqdmULEZHVg2Oo9E6CcTkptLXTrdp2bQ15jinLsOa+hrNJwwswtdKs4=----ATTACHMENT:----NzY2ODI0OTY5MTk4Njc4NyAzMzMzODY4NzIwMjAzNjc5IDEwNjgzMzQ5MDQ2ODM1MDY=