You are here

protected function MenuResourceTestBase::createEntity in Drupal 8

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

Creates the entity to be tested.

Return value

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

Overrides EntityResourceTestBase::createEntity

File

core/modules/system/tests/src/Functional/Rest/MenuResourceTestBase.php, line 35

Class

MenuResourceTestBase

Namespace

Drupal\Tests\system\Functional\Rest

Code

protected function createEntity() {
  $menu = Menu::create([
    'id' => 'menu',
    'label' => 'Menu',
    'description' => 'Menu',
  ]);
  $menu
    ->save();
  return $menu;
}