summaryrefslogtreecommitdiffstats
path: root/tests/src/Unit/Plugin
diff options
context:
space:
mode:
authorborisson_2016-01-25 09:33:39 (GMT)
committerJoris Vercammen2016-01-25 09:33:39 (GMT)
commit3a44b3d8d56c963a6ec7a5666d062bac1b4b99db (patch)
treea398ca32d555e20510cb02a285c6caa13d5fd162 /tests/src/Unit/Plugin
parent3ac6b333b41889446a5e55c92b0a52d5fb0cfe5f (diff)
Issue #2625186 by borisson_, michiellucas, StryKaizer: Support and/or for facets
Diffstat (limited to 'tests/src/Unit/Plugin')
-rw-r--r--tests/src/Unit/Plugin/query_type/SearchApiStringTest.php5
-rw-r--r--tests/src/Unit/Plugin/widget/LinksWidgetTest.php23
2 files changed, 4 insertions, 24 deletions
diff --git a/tests/src/Unit/Plugin/query_type/SearchApiStringTest.php b/tests/src/Unit/Plugin/query_type/SearchApiStringTest.php
index cecd79f..9f15b78 100644
--- a/tests/src/Unit/Plugin/query_type/SearchApiStringTest.php
+++ b/tests/src/Unit/Plugin/query_type/SearchApiStringTest.php
@@ -24,7 +24,10 @@ class SearchApiStringTest extends UnitTestCase {
*/
public function testQueryType() {
$query = new SearchApiQuery([], 'search_api_query', []);
- $facet = new Facet([], 'facets_facet');
+ $facet = new Facet(
+ ['options' => ['query_operator' => 'AND']],
+ 'facets_facet'
+ );
$original_results = [
['count' => 3, 'filter' => 'badger'],
diff --git a/tests/src/Unit/Plugin/widget/LinksWidgetTest.php b/tests/src/Unit/Plugin/widget/LinksWidgetTest.php
index 7e4424c..49b99fc 100644
--- a/tests/src/Unit/Plugin/widget/LinksWidgetTest.php
+++ b/tests/src/Unit/Plugin/widget/LinksWidgetTest.php
@@ -79,29 +79,6 @@ class LinksWidgetTest extends UnitTestCase {
/**
* Test widget.
*/
- public function testHideEmptyCount() {
- $original_results = $this->originalResults;
- $original_results[1] = new Result('badger', 'Badger', 0);
-
- $facet = new Facet([], 'facet');
- $facet->setResults($original_results);
- $facet->setWidgetConfigs(['show_numbers' => 1]);
-
- $output = $this->widget->build($facet);
-
- $this->assertInternalType('array', $output);
- $this->assertCount(3, $output['#items']);
-
- $expected_links = ['Llama (10)', 'Duck (15)', 'Alpaca (9)'];
- foreach ($expected_links as $index => $value) {
- $this->assertInstanceOf('\Drupal\Core\Link', $output['#items'][$index]);
- $this->assertEquals($value, $output['#items'][$index]->getText());
- }
- }
-
- /**
- * Test widget.
- */
public function testActiveItems() {
$original_results = $this->originalResults;
$original_results[0]->setActiveState(TRUE);