You are here

public function IgnoreCaseTest::testIsNullConditions in Search API 8

Tests whether "IS NULL" conditions are correctly kept.

See also

https://www.drupal.org/project/search_api/issues/3212925

File

tests/src/Unit/Processor/IgnoreCaseTest.php, line 66

Class

IgnoreCaseTest
Tests the "Ignore case" processor.

Namespace

Drupal\Tests\search_api\Unit\Processor

Code

public function testIsNullConditions() {
  $this
    ->setUpMockContainer();
  $index = $this
    ->createMock(IndexInterface::class);
  $index
    ->method('getFields')
    ->willReturn([
    'field' => (new Field($index, 'field'))
      ->setType('string'),
  ]);
  $this->processor
    ->setIndex($index);
  $passed_value = NULL;
  $this
    ->invokeMethod('processConditionValue', [
    &$passed_value,
  ]);
  $this
    ->assertSame(NULL, $passed_value);
  $condition = new Condition('field', NULL);
  $conditions = [
    $condition,
  ];
  $this
    ->invokeMethod('processConditions', [
    &$conditions,
  ]);
  $this
    ->assertSame([
    $condition,
  ], $conditions);
}