function MenuBlockPostUpdateTest::testPostUpdateMenuBlockFields

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']);
}

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