You are here

protected function BackendTest::checkFieldIdChanges in Search API 8

Checks that field ID changes are treated correctly (without re-indexing).

1 call to BackendTest::checkFieldIdChanges()
BackendTest::checkBackendSpecificFeatures in modules/search_api_db/tests/src/Kernel/BackendTest.php
Checks backend specific features.

File

modules/search_api_db/tests/src/Kernel/BackendTest.php, line 535

Class

BackendTest
Tests index and search capabilities using the Database search backend.

Namespace

Drupal\Tests\search_api_db\Kernel

Code

protected function checkFieldIdChanges() {
  $this
    ->getIndex()
    ->renameField('type', 'foobar')
    ->save();
  $results = $this
    ->buildSearch(NULL, [
    'foobar,item',
  ])
    ->execute();
  $this
    ->assertResults([
    1,
    2,
    3,
  ], $results, 'Search after renaming a field.');
  $this
    ->getIndex()
    ->renameField('foobar', 'type')
    ->save();
}