public function testFetchError() { $url = "https://raw.githubusercontent.com/ua-parser/uap-core/master/regexes.yaml"; $fetcher = new Fetcher(stream_context_create(array('ssl' => array('verify_peer' => true, Fetcher::getPeerNameKey() => 'invalid.com')))); $this->setExpectedException('UAParser\\Exception\\FetcherException', 'Could not fetch HTTP resource "' . $url . '": file_get_contents(' . $url . '): failed to open stream: operation failed'); $fetcher->fetch(); }