You are here

protected function MenuLinkContentTest::createEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/tests/src/Functional/MenuLinkContentTest.php \Drupal\Tests\jsonapi\Functional\MenuLinkContentTest::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/MenuLinkContentTest.php, line 65

Class

MenuLinkContentTest
JSON:API integration test for the "MenuLinkContent" content entity type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function createEntity() {
  $menu_link = MenuLinkContent::create([
    'id' => 'llama',
    'title' => 'Llama Gabilondo',
    'description' => 'Llama Gabilondo',
    'link' => 'https://nl.wikipedia.org/wiki/Llama',
    'weight' => 0,
    'menu_name' => 'main',
  ]);
  $menu_link
    ->save();
  return $menu_link;
}