You are here

public function SearchCrudTest::testLoad in Search API Autocomplete 8

Tests whether loading a search entity works correctly.

File

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

Class

SearchCrudTest
Tests saving a Search API autocomplete config entity.

Namespace

Drupal\Tests\search_api_autocomplete\Kernel

Code

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