public function IgnoreCharacterTest::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/ IgnoreCharacterTest.php, line 148
Class
- IgnoreCharacterTest
- Tests the "Ignore characters" processor.
Namespace
Drupal\Tests\search_api\Unit\ProcessorCode
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);
}