You are here

public function UserCrudReactionTest::testIndexDelete in Search API Saved Searches 8

Verifies correct reaction to the deletion of a search index.

Since the underlying function called is the same as for user deletion (and there are no other reactions to index CRUD events), this is tested as part of this test case.

See also

search_api_saved_searches_search_api_index_delete()

File

tests/src/Kernel/UserCrudReactionTest.php, line 210

Class

UserCrudReactionTest
Verifies that the module reacts correctly to user CRUD operations.

Namespace

Drupal\Tests\search_api_saved_searches\Kernel

Code

public function testIndexDelete() {
  $this
    ->installConfig([
    'search_api',
  ]);
  $index = Index::create([
    'id' => 'test',
  ]);
  $index
    ->save();
  $this->savedSearches[0]
    ->set('index_id', 'test')
    ->save();
  $index
    ->delete();
  $this
    ->reloadSavedSearches();
  $this
    ->assertEmpty($this->savedSearches[0]);
  $this
    ->assertNotEmpty($this->savedSearches[1]);
}