From e42edb9c01300a2c4716270985b437040a1e1a82 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Fri, 4 Nov 2016 12:27:05 -0400 Subject: [PATCH] Added crude facet support to test harness. --- .../src/VuFindTest/Search/TestHarness/Results.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/module/VuFind/src/VuFindTest/Search/TestHarness/Results.php b/module/VuFind/src/VuFindTest/Search/TestHarness/Results.php index 473d3fef7f4..5618e68a0bf 100644 --- a/module/VuFind/src/VuFindTest/Search/TestHarness/Results.php +++ b/module/VuFind/src/VuFindTest/Search/TestHarness/Results.php @@ -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; } /** -- GitLab