You are here

protected function FormModeManagerBase::createBlockContent in Form mode manager 8.2

Creates a block_content based on default settings.

Parameters

array $settings: (optional) An associative array of settings for the node, as used in entity_create(). Override the defaults by specifying the key and value in the array, for example:.

Return value

\Drupal\block_content\BlockContentInterface The created block_content entity.

1 call to FormModeManagerBase::createBlockContent()
FormModeManagerUiTest::setUp in tests/src/Functional/FormModeManagerUiTest.php

File

tests/src/Functional/FormModeManagerBase.php, line 227

Class

FormModeManagerBase
Provides a test case for form_mode_manager functional tests.

Namespace

Drupal\Tests\form_mode_manager\Functional

Code

protected function createBlockContent(array $settings = []) {

  // Populate defaults array.
  $settings += [
    'body' => [
      [
        'value' => $this
          ->randomMachineName(32),
        'format' => filter_default_format(),
      ],
    ],
    'info' => $this
      ->randomMachineName(),
    'type' => 'basic',
    'langcode' => 'en',
  ];
  $block_content = BlockContent::create($settings);
  $block_content
    ->save();
  return $block_content;
}