diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php index 21ae3f9..f272c76 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php @@ -30,34 +30,30 @@ public static function getInfo() { function setUp() { parent::setUp(); - $this->admin_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages')); + $this->admin_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages', 'administer blocks')); $this->drupalLogin($this->admin_user); // This test puts menu links in the Tools menu and then tests for their // presence on the page, so we need to ensure that the Tools block will be // displayed in all active themes. - db_update('block') - ->fields(array( - // Use a region that is valid for all themes. - 'region' => 'content', - 'status' => 1, - )) - ->condition('module', 'system') - ->condition('delta', 'menu-tools') - ->execute(); + $default_theme = variable_get('theme_default', 'stark'); + $this->drupalGet("admin/structure/block/list/block_plugin_ui:{$default_theme}/add"); + $block = array( + 'machine_name' => $this->randomName(8), + 'region' => 'sidebar_first', + ); + $this->drupalPost("admin/structure/block/manage/system_menu_block:menu-tools/{$default_theme}", $block, t('Save block')); + // This test puts menu links in the Administration menu and then tests for // their presence on the page, so we need to ensure that the Administration // block will be displayed in all active themes. - db_update('block') - ->fields(array( - // Use a region that is valid for all themes. - 'region' => 'content', - 'status' => 1, - )) - ->condition('module', 'system') - ->condition('delta', 'menu-admin') - ->execute(); + $this->drupalGet("admin/structure/block/list/block_plugin_ui:{$default_theme}/add"); + $block = array( + 'machine_name' => $this->randomName(8), + 'region' => 'sidebar_first', + ); + $this->drupalPost("admin/structure/block/manage/system_menu_block:menu-admin/{$default_theme}", $block, t('Save block')); } /**