function ViewResourceTestBase::createEntity

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Functional/Rest/ViewResourceTestBase.php \Drupal\Tests\views\Functional\Rest\ViewResourceTestBase::createEntity()
  2. 10 core/modules/views/tests/src/Functional/Rest/ViewResourceTestBase.php \Drupal\Tests\views\Functional\Rest\ViewResourceTestBase::createEntity()
  3. 11.x core/modules/views/tests/src/Functional/Rest/ViewResourceTestBase.php \Drupal\Tests\views\Functional\Rest\ViewResourceTestBase::createEntity()

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.