public function testSetPortSetsValue() { $url = 'http://example.com/path'; $uri = new URI($url); $expected = 'http://example.com:9000/path'; $uri->setPort(9000); $this->assertEquals(9000, $uri->getPort()); $this->assertEquals($expected, (string) $uri); }