You are here

protected function ViewResourceTestBase::createEntity in Drupal 9

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

Creates the entity to be tested.

Return value

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

Overrides EntityResourceTestBase::createEntity

File

core/modules/views/tests/src/Functional/Rest/ViewResourceTestBase.php, line 35

Class

ViewResourceTestBase

Namespace

Drupal\Tests\views\Functional\Rest

Code

protected function createEntity() {
  $view = View::create([
    'id' => 'test_rest',
    'label' => 'Test REST',
  ]);
  $view
    ->save();
  return $view;
}