function MenuBlockDepthTest::testUpdate

Tests that menu blocks with a `depth` setting of 0 are changed to NULL.

File

core/modules/block/tests/src/Functional/Update/MenuBlockDepthTest.php, line 30

Class

MenuBlockDepthTest
Tests update path for the `depth` setting of menu blocks.

Namespace

Drupal\Tests\block\Functional\Update

Code

public function testUpdate() : void {
  $settings = Block::load('olivero_account_menu')?->get('settings');
  $this->assertIsArray($settings);
  $this->assertSame(0, $settings['depth']);
  $this->runUpdates();
  $settings = Block::load('olivero_account_menu')?->get('settings');
  $this->assertIsArray($settings);
  $this->assertNull($settings['depth']);
}

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