You are here

protected function LayoutBuilderInlineBlockStubCleanupTest::createEntity in Acquia Content Hub 8.2

Create a basic type block entity.

Return value

\Drupal\block_content\Entity\BlockContent Returns the newly created block content.

Throws

\Drupal\Core\Entity\EntityStorageException

1 call to LayoutBuilderInlineBlockStubCleanupTest::createEntity()
LayoutBuilderInlineBlockStubCleanupTest::testLayoutBuilderInlineBlockStubCleanup in tests/src/Kernel/EventSubscriber/CleanUpStubs/LayoutBuilderInlineBlockStubCleanupTest.php
Tests LayoutBuilderInlineBlockStubCleanup event subscriber.

File

tests/src/Kernel/EventSubscriber/CleanUpStubs/LayoutBuilderInlineBlockStubCleanupTest.php, line 119

Class

LayoutBuilderInlineBlockStubCleanupTest
Test that LB inline block is handled correctly in CLEANUP_STUBS event.

Namespace

Drupal\Tests\acquia_contenthub\Kernel\EventSubscriber\CleanUpStubs

Code

protected function createEntity() {
  $block_content = BlockContent::create([
    'info' => 'Test',
    'type' => 'basic',
    'body' => [
      'value' => 'Test.',
      'format' => 'plain_text',
    ],
  ]);
  $block_content
    ->save();
  return $block_content;
}