You are here

public function MenuBlockPostUpdateTest::testPostUpdateMenuBlockFields in Drupal 8

Tests updating blocks with default 'expand_all_items' value.

See also

system_post_update_add_expand_all_items_key_in_system_menu_block()

File

core/modules/system/tests/src/Functional/Update/MenuBlockPostUpdateTest.php, line 37

Class

MenuBlockPostUpdateTest
Tests updating menu blocks configuration.

Namespace

Drupal\Tests\system\Functional\Update

Code

public function testPostUpdateMenuBlockFields() {
  $this
    ->assertArrayNotHasKey('expand_all_items', Block::load('bartik_account_menu')
    ->get('settings'));
  $this
    ->runUpdates();
  $settings = Block::load('bartik_account_menu')
    ->get('settings');
  $this
    ->assertArrayHasKey('expand_all_items', $settings);
  $this
    ->assertFalse($settings['expand_all_items']);
}