function ModerationStateBlockTest::setUp

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/tests/src/Functional/ModerationStateBlockTest.php \Drupal\Tests\content_moderation\Functional\ModerationStateBlockTest::setUp()
  2. 8.9.x core/modules/content_moderation/tests/src/Functional/ModerationStateBlockTest.php \Drupal\Tests\content_moderation\Functional\ModerationStateBlockTest::setUp()
  3. 11.x core/modules/content_moderation/tests/src/Functional/ModerationStateBlockTest.php \Drupal\Tests\content_moderation\Functional\ModerationStateBlockTest::setUp()

Sets the test up.

Overrides ModerationStateTestBase::setUp

File

core/modules/content_moderation/tests/src/Functional/ModerationStateBlockTest.php, line 33

Class

ModerationStateBlockTest
Tests general content moderation workflow for blocks.

Namespace

Drupal\Tests\content_moderation\Functional

Code

protected function setUp() : void {
  parent::setUp();
  // Create the "basic" block type.
  $bundle = BlockContentType::create([
    'id' => 'basic',
    'label' => 'basic',
    'revision' => FALSE,
  ]);
  $bundle->save();
  // Add the body field to it.
  block_content_add_body_field($bundle->id());
}

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