function ConfigActionsTest::testPlaceBlockInStaticRegion

@testWith ["placeBlockInDefaultTheme", "olivero"] ["placeBlockInAdminTheme", "claro"]

File

core/modules/block/tests/src/Kernel/ConfigActionsTest.php, line 126

Class

ConfigActionsTest
@covers \Drupal\block\Plugin\ConfigAction\PlaceBlock @covers \Drupal\block\Plugin\ConfigAction\PlaceBlockDeriver @group block

Namespace

Drupal\Tests\block\Kernel

Code

public function testPlaceBlockInStaticRegion(string $action, string $expected_theme) : void {
    $this->configActionManager
        ->applyAction($action, 'block.block.test_block', [
        'plugin' => 'system_powered_by_block',
        'region' => 'content',
    ]);
    $block = Block::load('test_block');
    $this->assertInstanceOf(Block::class, $block);
    $this->assertSame('system_powered_by_block', $block->getPluginId());
    $this->assertSame($expected_theme, $block->getTheme());
    $this->assertSame('content', $block->getRegion());
}

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