You are here

protected function FilterFormatTest::createEntity in JSON:API 8.2

Same name and namespace in other branches
  1. 8 tests/src/Functional/FilterFormatTest.php \Drupal\Tests\jsonapi\Functional\FilterFormatTest::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/FilterFormatTest.php, line 47

Class

FilterFormatTest
JSON:API integration test for the "FilterFormat" config entity type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

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