function ConfigActionsTest::testPlaceBlockActionDoesNotChangeExistingBlock
Verifies placeBlockInDefaultTheme action doesn't alter an existing block.
File
- 
              core/
modules/ block/ tests/ src/ Kernel/ ConfigActionsTest.php, line 98  
Class
- ConfigActionsTest
 - Tests Config Actions.
 
Namespace
Drupal\Tests\block\KernelCode
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.