You are here

protected function PagesIntegrationTest::checkEntityDependencies in Search API Autocomplete 8

Verifies that the search entity's dependencies were calculated correctly.

1 call to PagesIntegrationTest::checkEntityDependencies()
PagesIntegrationTest::testModule in tests/src/FunctionalJavascript/PagesIntegrationTest.php
Tests autocomplete for search pages.

File

tests/src/FunctionalJavascript/PagesIntegrationTest.php, line 137

Class

PagesIntegrationTest
Tests integration with the Search API Pages module.

Namespace

Drupal\Tests\search_api_autocomplete\FunctionalJavascript

Code

protected function checkEntityDependencies() {

  /** @var \Drupal\search_api_autocomplete\SearchInterface $search */
  $search = Search::load($this->searchId);
  $expected = [
    'config' => [
      'search_api.index.autocomplete_search_index',
      "search_api_page.search_api_page.{$this->searchId}",
    ],
    'module' => [
      'search_api_autocomplete',
      'search_api_autocomplete_test',
      'search_api_page',
    ],
  ];
  $dependencies = $search
    ->getDependencies();
  ksort($dependencies);
  sort($dependencies['config']);
  sort($dependencies['module']);
  $this
    ->assertEquals($expected, $dependencies);
}