function BlockValidationTest::setUp

Same name in other branches
  1. 11.x core/modules/block/tests/src/Kernel/BlockValidationTest.php \Drupal\Tests\block\Kernel\BlockValidationTest::setUp()

Overrides ConfigEntityValidationTestBase::setUp

File

core/modules/block/tests/src/Kernel/BlockValidationTest.php, line 27

Class

BlockValidationTest
Tests validation of block entities.

Namespace

Drupal\Tests\block\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->entity = Block::create([
        'id' => 'test_block',
        'theme' => 'stark',
        'plugin' => 'system_powered_by_block',
        'settings' => [
            'label' => 'Powered by Drupal 🚀',
        ],
    ]);
    $this->entity
        ->save();
}

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