function ConfigActionsTest::testPlaceBlockActionDoesNotChangeExistingBlock

Verifies placeBlockInDefaultTheme action doesn't alter an existing block.

File

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

Class

ConfigActionsTest
@covers \Drupal\block\Plugin\ConfigAction\PlaceBlock[[api-linebreak]] @covers \Drupal\block\Plugin\ConfigAction\PlaceBlockDeriver[[api-linebreak]] @group block

Namespace

Drupal\Tests\block\Kernel

Code

public function testPlaceBlockActionDoesNotChangeExistingBlock() : void {
  $extant_region = Block::load('olivero_powered')->getRegion();
  $this->assertNotSame('content', $extant_region);
  $this->configActionManager
    ->applyAction('placeBlockInDefaultTheme', 'block.block.olivero_powered', [
    'plugin' => 'system_powered_by_block',
    'region' => [
      'olivero' => 'content',
    ],
  ]);
  // The extant block should be unchanged.
  $this->assertSame($extant_region, Block::load('olivero_powered')->getRegion());
}

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