You are here

protected function FilterFormatResourceTestBase::createEntity in Drupal 8

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

Creates the entity to be tested.

Return value

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

Overrides EntityResourceTestBase::createEntity

File

core/modules/filter/tests/src/Functional/Rest/FilterFormatResourceTestBase.php, line 35

Class

FilterFormatResourceTestBase

Namespace

Drupal\Tests\filter\Functional\Rest

Code

protected function createEntity() {
  $pablo_format = FilterFormat::create([
    'name' => 'Pablo Picasso',
    'format' => 'pablo',
    'langcode' => 'es',
    'filters' => [
      'filter_html' => [
        'status' => TRUE,
        'settings' => [
          'allowed_html' => '<p> <a> <b> <lo>',
        ],
      ],
    ],
  ]);
  $pablo_format
    ->save();
  return $pablo_format;
}