Commit dbb94e74 authored by Bas de Nooijer's avatar Bas de Nooijer

fixed tests and some bugs

parent 01a2043d
......@@ -37,20 +37,22 @@ class Solarium_Client_Request_Select extends Solarium_Client_Request
public function _init()
{
$sort = array();
foreach ($this->_query->getSortFields() AS $field => $order) {
$sort[] = $field . ' ' . $order;
}
$this->_params = array(
'q' => $this->_query->getQuery(),
'start' => $this->_query->getStart(),
'rows' => $this->_query->getRows(),
'fl' => implode(',', $this->_query->getFields()),
'sort' => implode(',', $sort),
'wt' => 'json',
);
$sort = array();
foreach ($this->_query->getSortFields() AS $field => $order) {
$sort[] = $field . ' ' . $order;
}
if (count($sort) !== 0) {
$this->addParam('sort',implode(',', $sort));
}
$filterQueries = $this->_query->getFilterQueries();
if (count($filterQueries) !== 0) {
foreach ($filterQueries AS $filterQuery) {
......
......@@ -401,7 +401,7 @@ class Solarium_Query_Select extends Solarium_Query
throw new Solarium_Exception('A filterquery must have a key value');
}
if (array_key_exists($key, $this->_facets)) {
if (array_key_exists($key, $this->_filterQueries)) {
throw new Solarium_Exception('A filterquery must have a unique key'
. ' value within a query');
}
......
......@@ -92,7 +92,7 @@ class Solarium_Client_Request_SelectTest extends PHPUnit_Framework_TestCase
);
$this->assertEquals(
'http://127.0.0.1:80/solr/select?q=*:*&start=0&rows=10&fl=*,score&sort=id asc, name desc&wt=json&fq={!tag=f1}published:true&fq={!tag=f2}category:23',
'http://127.0.0.1:80/solr/select?q=*:*&start=0&rows=10&fl=*,score&sort=id asc,name desc&wt=json&fq={!tag=f1}published:true&fq={!tag=f2}category:23',
urldecode($request->getUrl())
);
}
......
......@@ -271,7 +271,7 @@ class Solarium_Query_SelectTest extends PHPUnit_Framework_TestCase
$this->_query->addFilterQueries($filterQueries);
$this->_query->removeFilterQuery('fq1');
$this->assertEquals(
array('f2' => $fq2),
array('fq2' => $fq2),
$this->_query->getFilterQueries()
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment