You are here

public function FieldsProcessorPluginBaseTest::testProcessKeysNoKeys in Search API 8

Tests whether preprocessing of queries without search keys works correctly.

File

tests/src/Unit/Processor/FieldsProcessorPluginBaseTest.php, line 397

Class

FieldsProcessorPluginBaseTest
Tests the base class for fields-based processors.

Namespace

Drupal\Tests\search_api\Unit\Processor

Code

public function testProcessKeysNoKeys() {
  $query = \Drupal::getContainer()
    ->get('search_api.query_helper')
    ->createQuery($this->index);
  $this->processor
    ->preprocessSearchQuery($query);
  $this
    ->assertNull($query
    ->getKeys(), 'Query without keys was correctly ignored.');
}