function FilterFormatTest::createEntity

Same name in other branches
  1. 9 core/modules/jsonapi/tests/src/Functional/FilterFormatTest.php \Drupal\Tests\jsonapi\Functional\FilterFormatTest::createEntity()
  2. 10 core/modules/jsonapi/tests/src/Functional/FilterFormatTest.php \Drupal\Tests\jsonapi\Functional\FilterFormatTest::createEntity()
  3. 11.x core/modules/jsonapi/tests/src/Functional/FilterFormatTest.php \Drupal\Tests\jsonapi\Functional\FilterFormatTest::createEntity()

Overrides ResourceTestBase::createEntity

File

core/modules/jsonapi/tests/src/Functional/FilterFormatTest.php, line 52

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 Picasso',
        'format' => 'pablo',
        'langcode' => 'es',
        'filters' => [
            'filter_html' => [
                'status' => TRUE,
                'settings' => [
                    'allowed_html' => '<p> <a> <b> <lo>',
                ],
            ],
        ],
    ]);
    $pablo_format->save();
    return $pablo_format;
}

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