1--TEST--
2Solr Bug #70482 - Segmentation fault on server 500 response with no msg field XML RW
3--SKIPIF--
4<?php require_once 'skip.if.server_not_configured.inc'; ?>
5--FILE--
6<?php
7
8require_once "bootstrap.inc";
9$options = array
10(
11		'hostname' => SOLR_SERVER_HOSTNAME,
12		'login'    => SOLR_SERVER_USERNAME,
13		'password' => SOLR_SERVER_PASSWORD,
14		'port'     => SOLR_SERVER_PORT,
15		'path'	   => SOLR_SERVER_PATH,
16		'wt'	   => 'xml'
17);
18
19$client = new SolrClient($options);
20
21$query = new SolrQuery('*:*');
22
23$func = new SolrCollapseFunction('manu_id_s');
24
25$func->setMax('sum(cscore(),field(manu_id_s))');
26$func->setSize(100);
27$func->setNullPolicy(SolrCollapseFunction::NULLPOLICY_EXPAND);
28
29$query->collapse($func);
30try {
31	$queryResponse = $client->query($query);
32} catch (SolrServerException $e) {
33	printf("Exception code %d", $e->getCode());
34	assert(strlen($e->getMessage()) > 0, 'Exception message is empty');
35	echo PHP_EOL;
36}
37
38?>
39OK
40--EXPECTF--
41Exception code %d
42OK