You are here

protected function IntegrationTest::checkUserIndexCreation in Search API 8

Tests that an entity without bundles can be used as a datasource.

1 call to IntegrationTest::checkUserIndexCreation()
IntegrationTest::testFramework in tests/src/Functional/IntegrationTest.php
Tests various operations via the Search API's admin UI.

File

tests/src/Functional/IntegrationTest.php, line 486

Class

IntegrationTest
Tests the overall functionality of the Search API framework and admin UI.

Namespace

Drupal\Tests\search_api\Functional

Code

protected function checkUserIndexCreation() {
  $edit = [
    'name' => 'IndexName',
    'id' => 'user_index',
    'datasources[entity:user]' => TRUE,
  ];
  $this
    ->drupalGet('admin/config/search/search-api/add-index');
  $this
    ->submitForm($edit, 'Save');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains('Please configure the used datasources.');
  $this
    ->submitForm([], 'Save');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains('The index was successfully saved.');
  $this
    ->assertSession()
    ->pageTextContains($edit['name']);
}