You are here

public function FacetFacetSourceTest::testQueryType in Facets 8

Tests valid query type.

@covers ::getQueryType @covers ::getFacetSource

File

tests/src/Kernel/Entity/FacetFacetSourceTest.php, line 125

Class

FacetFacetSourceTest
Class FacetFacetSourceTest.

Namespace

Drupal\Tests\facets\Kernel\Entity

Code

public function testQueryType() {
  $entity = new Facet([], 'facets_facet');
  $entity
    ->setWidget('links');
  $entity
    ->setFacetSourceId('search_api:views_page__search_api_test_view__page_1');
  $entity
    ->setFieldIdentifier('name');
  $selectedQueryType = $entity
    ->getQueryType();
  $this
    ->assertEquals('search_api_string', $selectedQueryType);
}