You are here

public function MonitoringSearchAPITest::setUp in Monitoring 8

Overrides MonitoringUnitTestBase::setUp

File

tests/src/Kernel/MonitoringSearchAPITest.php, line 38

Class

MonitoringSearchAPITest
Tests for search API sensor.

Namespace

Drupal\Tests\monitoring\Kernel

Code

public function setUp() {
  parent::setUp();

  // Install required database tables for each module.
  $this
    ->installSchema('search_api', [
    'search_api_item',
  ]);
  $this
    ->installEntitySchema('search_api_task');
  $this
    ->installSchema('system', [
    'key_value_expire',
  ]);
  $this
    ->installSchema('user', [
    'users_data',
  ]);

  // Install the schema for entity entity_test_mulrev_changed.
  $this
    ->installEntitySchema('entity_test_mulrev_changed');

  // Set up the required bundles.
  $this
    ->createEntityTestBundles();

  // Install the test search API index and server used by the test.
  $this
    ->installConfig([
    'search_api',
    'search_api_test_db',
  ]);
  \Drupal::service('search_api.index_task_manager')
    ->addItemsAll(Index::load('database_search_index'));
}