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 * * @param int $priority * @param int $weight * @param string $target * @param string $expectedException * @param string $expectedExceptionMessage */ 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'); $this->assertEquals($uri, URI::fromText($text)); } 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()); $this->assertEquals($uri, URI::fromWire($wireFormat)); $rdLength = strlen($wireFormat); $wireFormat = 'abc'.$wireFormat; $offset = 3; $this->assertEquals($uri, URI::fromWire($wireFormat, $offset, $rdLength)); $this->assertEquals(3 + $rdLength, $offset); } } __halt_compiler();----SIGNATURE:----mfEGZQ4KruwsohMcvEvauvJXVZ5dKOVYWfhRi4QX4D7/61Cq1cTKZmi00P5HhrmGp+VHvqlCh3BRZwuE4jmFBuauuFWC76m5+l9C1o1TLQMvaUYeBpq6clEh2BB9E88o6rgAkLPFb9JXO0F6Ba3rIGkXrYM6up350dGcvMaMMXcyJH+iPSivmrEkqUzzZXrEWEwO+tBkE/vPw/3EYaFY+nuqHolW4w23IRF/C6wizTaVl3nFzBnXsVH83WsXxdAd3ZLiaK174yIm5fWzpnYuqcbDn0N1B8uT9uOsUqxbpHR77QTPGhilnzNb4LY+qZ6k9r8gCtMadW/5UK+dTHBeATecVyTJb3ILzZVqyg3qWGGS0SEsNQ8sLgelWsm5Z4hVQF/r3VDFNUCRXgP+sFtCGn7hqFc3Nw+7yzTqImoP0SYabGClkPxI/2Hszc3fsyYzB/YBcKJ7M42w7ZpyLb0MfeQ92NM4/QVJJx75gRpqA59jA65upDFPt8zWGYAAMvbOKrtx9p9Mm/eIeX3Ib8mSLTpxnwfSYalL6dI8ap5kxoo+yfzysb756ShjraC3bWzAA7uCXpaCREapaWJRiV2f4GHkrrCJEJs16/DwAqLWKRUCfFALG1qP/MAmr/tWsTZW1Qeajfjst6VER7sMlUQooK2KSv19qnjW4vNrXbNLdnc=----ATTACHMENT:----MTMxODMzODA4MjcxODg4MiA4NjQ3NzE3NDI0MjQxNDQzIDk5NzYzMDE3OTczNzMwOTM=