1--TEST-- 2SolrServerException (xml) - Throw Exception on solr server exception using xml response writer 3--SKIPIF-- 4<?php 5include 'skip.if.server_not_configured.inc'; 6?> 7--FILE-- 8<?php 9require_once "bootstrap.inc"; 10 11$options = array ( 12 'hostname' => SOLR_SERVER_HOSTNAME, 13 'login' => SOLR_SERVER_USERNAME, 14 'password' => SOLR_SERVER_PASSWORD, 15 'port' => SOLR_SERVER_PORT, 16 'path' => SOLR_SERVER_PATH, 17// 'wt' => 'xml' 18); 19 20$client = new SolrClient ( $options ); 21$query = new SolrQuery ( "lucene\\" ); 22try { 23 $response = $client->query ( $query ); 24} catch ( SolrServerException $e ) { 25 echo sprintf("code: %d", $e->getCode()).PHP_EOL; 26 echo sprintf("message: %s", $e->getMessage()).PHP_EOL; 27 print_r($e->getInternalInfo()); 28} 29 30?> 31--EXPECTF-- 32code: %d 33message: %s 34Array 35( 36 [sourceline] => %d 37 [sourcefile] => %s 38 [zif_name] => %s 39) 40