You are here

protected function BackendTestBase::regressionTest2127001 in Search API 8

Regression tests for non-working operator "contains none of these words".

See also

https://www.drupal.org/node/2127001

1 call to BackendTestBase::regressionTest2127001()
BackendTestBase::regressionTests in tests/src/Kernel/BackendTestBase.php
Executes regression tests for issues that were already fixed.

File

tests/src/Kernel/BackendTestBase.php, line 621

Class

BackendTestBase
Provides a base class for backend tests.

Namespace

Drupal\Tests\search_api\Kernel

Code

protected function regressionTest2127001() {
  $keys = [
    '#conjunction' => 'AND',
    '#negation' => TRUE,
    'foo',
    'bar',
  ];
  $results = $this
    ->buildSearch($keys)
    ->execute();
  $this
    ->assertResults([
    3,
    4,
  ], $results, 'Negated AND fulltext search');
  $keys = [
    '#conjunction' => 'OR',
    '#negation' => TRUE,
    'foo',
    'baz',
  ];
  $results = $this
    ->buildSearch($keys)
    ->execute();
  $this
    ->assertResults([
    3,
  ], $results, 'Negated OR fulltext search');
  $keys = [
    '#conjunction' => 'AND',
    'test',
    [
      '#conjunction' => 'AND',
      '#negation' => TRUE,
      'foo',
      'bar',
    ],
  ];
  $results = $this
    ->buildSearch($keys)
    ->execute();
  $this
    ->assertResults([
    3,
    4,
  ], $results, 'Nested NOT AND fulltext search');
}