You are here

protected function MenuLinkContentTest::createEntity in JSON:API 8.2

Same name and namespace in other branches
  1. 8 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

tests/src/Functional/MenuLinkContentTest.php, line 57

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