You are here

public function QueryTest::testDisplayPluginIntegration in Search API 8

Tests whether the display plugin integration works correctly.

File

tests/src/Kernel/System/QueryTest.php, line 216

Class

QueryTest
Tests query functionality.

Namespace

Drupal\Tests\search_api\Kernel\System

Code

public function testDisplayPluginIntegration() {
  $query = $this->index
    ->query();
  $this
    ->assertSame(NULL, $query
    ->getSearchId(FALSE));
  $this
    ->assertSame('search_1', $query
    ->getSearchId());
  $this
    ->assertSame('search_1', $query
    ->getSearchId(FALSE));
  $this
    ->assertSame(NULL, $query
    ->getDisplayPlugin());
  $query = $this->index
    ->query()
    ->setSearchId('search_api_test');
  $this
    ->assertInstanceOf('Drupal\\search_api_test\\Plugin\\search_api\\display\\TestDisplay', $query
    ->getDisplayPlugin());
}