protected function SearchApiSolrTest::regressionTest2888629 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::regressionTest2888629()
- 8.2 tests/src/Kernel/SearchApiSolrTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrTest::regressionTest2888629()
- 4.x tests/src/Kernel/SearchApiSolrTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrTest::regressionTest2888629()
Regression tests for #2888629.
1 call to SearchApiSolrTest::regressionTest2888629()
- SearchApiSolrTest::backendSpecificRegressionTests in tests/
src/ Kernel/ SearchApiSolrTest.php - Runs backend specific regression tests.
File
- tests/
src/ Kernel/ SearchApiSolrTest.php, line 236
Class
- SearchApiSolrTest
- Tests index and search capabilities using the Solr search backend.
Namespace
Drupal\Tests\search_api_solr\KernelCode
protected function regressionTest2888629() {
$query = $this
->buildSearch();
$query
->addCondition('category', NULL);
$results = $query
->execute();
$this
->assertResults([
3,
], $results, 'comparing against NULL');
$query = $this
->buildSearch();
$conditions = $query
->createConditionGroup('OR');
$conditions
->addCondition('category', 'article_category', '<>');
$conditions
->addCondition('category', NULL);
$query
->addConditionGroup($conditions);
$results = $query
->execute();
$this
->assertResults([
1,
2,
3,
], $results, 'group comparing against category NOT article_category OR category NULL');
$query = $this
->buildSearch();
$conditions = $query
->createConditionGroup('AND');
$conditions
->addCondition('body', NULL, '<>');
$conditions
->addCondition('category', 'article_category', '<>');
$conditions
->addCondition('category', NULL, '<>');
$query
->addConditionGroup($conditions);
$results = $query
->execute();
$this
->assertResults([
1,
2,
], $results, 'group comparing against body NOT NULL AND category NOT article_category AND category NOT NULL');
}