public function testSetPortZero() { $url = 'http://example.com/path'; $uri = new URI($url); $this->setExpectedException('InvalidArgumentException', 'Invalid port given.'); $uri->setPort(0); }