protected function BackendTestBase::regressionTest1403916 in Search API 8
Regression tests for multi word search results sets and wrong facet counts.
See also
https://www.drupal.org/node/1403916
1 call to BackendTestBase::regressionTest1403916()
- BackendTestBase::regressionTests in tests/
src/ Kernel/ BackendTestBase.php - Executes regression tests for issues that were already fixed.
File
- tests/
src/ Kernel/ BackendTestBase.php, line 736
Class
- BackendTestBase
- Provides a base class for backend tests.
Namespace
Drupal\Tests\search_api\KernelCode
protected function regressionTest1403916() {
$query = $this
->buildSearch('test foo');
$facets = [];
$facets['type'] = [
'field' => 'type',
'limit' => 0,
'min_count' => 1,
'missing' => TRUE,
];
$query
->setOption('search_api_facets', $facets);
$query
->range(0, 0);
$results = $query
->execute();
$expected = [
[
'count' => 2,
'filter' => '"item"',
],
[
'count' => 1,
'filter' => '"article"',
],
];
$facets = $results
->getExtraData('search_api_facets', [])['type'];
usort($facets, [
$this,
'facetCompare',
]);
$this
->assertEquals($expected, $facets, 'Correct facets were returned');
}