You are here

protected function SearchPageTest::createEntity in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/tests/src/Functional/SearchPageTest.php \Drupal\Tests\jsonapi\Functional\SearchPageTest::createEntity()

Creates the entity to be tested.

Return value

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

Overrides ResourceTestBase::createEntity

File

core/modules/jsonapi/tests/src/Functional/SearchPageTest.php, line 62

Class

SearchPageTest
JSON:API integration test for the "SearchPage" config entity type.

Namespace

Drupal\Tests\jsonapi\Functional

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;
}