You are here

public function SearchApiStringTest::testConfiguration in Facets 8

Tests string query type without results.

File

tests/src/Unit/Plugin/query_type/SearchApiStringTest.php, line 127

Class

SearchApiStringTest
Unit test for query type.

Namespace

Drupal\Tests\facets\Unit\Plugin\query_type

Code

public function testConfiguration() {
  $query = new SearchApiQuery([], 'search_api_query', []);
  $facet = new Facet([], 'facets_facet');
  $default_config = [
    'facet' => $facet,
    'query' => $query,
  ];
  $query_type = new SearchApiString($default_config, 'search_api_string', []);
  $this
    ->assertEquals([], $query_type
    ->defaultConfiguration());
  $this
    ->assertEquals($default_config, $query_type
    ->getConfiguration());
  $query_type
    ->setConfiguration([
    'owl' => 'Long-eared owl',
  ]);
  $this
    ->assertEquals([
    'owl' => 'Long-eared owl',
  ], $query_type
    ->getConfiguration());
}