You are here

protected function SearchPageResourceTestBase::createEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/search/tests/src/Functional/Rest/SearchPageResourceTestBase.php \Drupal\Tests\search\Functional\Rest\SearchPageResourceTestBase::createEntity()

Creates the entity to be tested.

Return value

\Drupal\Core\Entity\EntityInterface The entity to be tested.

Overrides EntityResourceTestBase::createEntity

File

core/modules/search/tests/src/Functional/Rest/SearchPageResourceTestBase.php, line 45

Class

SearchPageResourceTestBase

Namespace

Drupal\Tests\search\Functional\Rest

Code

protected function createEntity() {
  $search_page = SearchPage::create([
    'id' => 'hinode_search',
    'plugin' => 'node_search',
    'label' => 'Search of magnetic activity of the Sun',
    'path' => 'sun',
  ]);
  $search_page
    ->save();
  return $search_page;
}