public function testWithPortThrowExceptionForInvalidPort() { $uri = new Uri('http://*****:*****@local.example.com:8080/foo?bar=baz#quz'); $this->setExpectedException('InvalidArgumentException'); $new = $uri->withPort(false); }