1--TEST-- 2Solr bug #59511 - SolrClient::query() Timeout shall throw a SolrClientException 3--SKIPIF-- 4<?php require_once 'skip.if.server_not_configured.inc'; ?> 5--FILE-- 6<?php 7 8require_once "bootstrap.inc"; 9// force to timeout trying to resolve 10$options = array 11( 12 'hostname' => 'anyhost', 13 'login' => SOLR_SERVER_USERNAME, 14 'password' => SOLR_SERVER_PASSWORD, 15 'port' => SOLR_SERVER_PORT, 16 'path' => SOLR_SERVER_PATH, 17 'timeout' => 2 18); 19 20$client = new SolrClient($options); 21$query = new SolrQuery("lucene"); 22try { 23 $query_response = $client->query($query); 24} catch (SolrClientException $e) { 25 echo $e->getMessage().PHP_EOL; 26 echo $e->getCode().PHP_EOL; 27} 28?> 29--EXPECTF-- 30Solr HTTP Error %d: '%s' 311004