Skip to content
Snippets Groups Projects
Commit e42edb9c authored by Demian Katz's avatar Demian Katz
Browse files

Added crude facet support to test harness.

parent 617cc0f8
No related merge requests found
......@@ -55,18 +55,27 @@ class Results extends \VuFind\Search\Base\Results
*/
protected $driverCache = [];
/**
* Fake facet response
*
* @var array
*/
protected $facets;
/**
* Constructor
*
* @param \VuFind\Search\Base\Params $params Object representing user search
* parameters.
* @param int $total Total result set size to simulate
* @param array $facets Facet response (optional)
*/
public function __construct(Params $params, $total = 100)
public function __construct(Params $params, $total = 100, $facets = [])
{
parent::__construct($params);
$this->fakeExpectedTotal = $total;
$this->searchId = 'fake'; // fill a fake value here so we don't hit the DB
$this->facets = $facets;
}
/**
......@@ -79,8 +88,7 @@ class Results extends \VuFind\Search\Base\Results
*/
public function getFacetList($filter = null)
{
// not supported
return [];
return $this->facets;
}
/**
......
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