protected function SearchApiSolrTest::regressionTest2469547 in Search API Solr 8
Same name and namespace in other branches
- 8.3 tests/src/Kernel/SearchApiSolrTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrTest::regressionTest2469547()
- 8.2 tests/src/Kernel/SearchApiSolrTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrTest::regressionTest2469547()
- 4.x tests/src/Kernel/SearchApiSolrTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrTest::regressionTest2469547()
Regression tests for #2469547.
Overrides BackendTestBase::regressionTest2469547
File
- tests/
src/ Kernel/ SearchApiSolrTest.php, line 212
Class
- SearchApiSolrTest
- Tests index and search capabilities using the Solr search backend.
Namespace
Drupal\Tests\search_api_solr\KernelCode
protected function regressionTest2469547() {
$query = $this
->buildSearch();
$facets = array();
$facets['body'] = array(
'field' => 'body',
'limit' => 0,
'min_count' => 1,
'missing' => FALSE,
);
$query
->setOption('search_api_facets', $facets);
$query
->addCondition('id', 5, '<>');
$query
->range(0, 0);
$results = $query
->execute();
$expected = $this
->getExpectedFacetsOfRegressionTest2469547();
// We can't guarantee the order of returned facets, since "bar" and "foobar"
// both occur once, so we have to manually sort the returned facets first.
$facets = $results
->getExtraData('search_api_facets', array())['body'];
usort($facets, array(
$this,
'facetCompare',
));
$this
->assertEquals($expected, $facets, 'Correct facets were returned for a fulltext field.');
}