public function testSetQueryThrowsErrorWhenFragmentPresent() { $url = 'http://example.com/path'; $uri = new URI($url); $expected = 'http://example.com/path?key=value'; $this->setExpectedException('InvalidArgumentException'); $uri->setQuery('?key=value#fragment'); }