function BlockValidationTest::setUp

Same name in other branches
  1. 10 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 46

Class

BlockValidationTest
Tests validation of block entities.

Namespace

Drupal\Tests\block\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->container
        ->get('theme_installer')
        ->install([
        'stark',
    ]);
    $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.