You are here

public function SearchCrudTest::testDelete in Search API Autocomplete 8

Tests whether deleting a search entity works correctly.

File

tests/src/Kernel/SearchCrudTest.php, line 162

Class

SearchCrudTest
Tests saving a Search API autocomplete config entity.

Namespace

Drupal\Tests\search_api_autocomplete\Kernel

Code

public function testDelete() {
  $values = $this
    ->getSearchTestValues();
  $search = Search::create($values);
  $search
    ->save();
  $loaded_search = Search::load($search
    ->id());
  $this
    ->assertInstanceOf(SearchInterface::class, $loaded_search);
  $search
    ->delete();
  $loaded_search = Search::load($search
    ->id());
  $this
    ->assertNull($loaded_search);
}