From 6c3b4bfc3748778b03ddfe86d7f9e09b10e8079b Mon Sep 17 00:00:00 2001
From: Dane Powell <git@danepowell.com>
Date: Wed, 28 Oct 2015 11:49:21 -0500
Subject: [PATCH] Issue #2603598 by Dane Powell: Use sane default region order
 and clean up block test.

---
 core/lib/Drupal/Core/Extension/ThemeHandler.php | 12 ++++++------
 core/modules/block/src/Tests/BlockUiTest.php    |  6 ++----
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/core/lib/Drupal/Core/Extension/ThemeHandler.php b/core/lib/Drupal/Core/Extension/ThemeHandler.php
index 1988a14..bc2011c 100644
--- a/core/lib/Drupal/Core/Extension/ThemeHandler.php
+++ b/core/lib/Drupal/Core/Extension/ThemeHandler.php
@@ -254,18 +254,18 @@ public function rebuildThemeData() {
       'engine' => 'twig',
       'base theme' => 'stable',
       'regions' => array(
-        'sidebar_first' => 'Left sidebar',
-        'sidebar_second' => 'Right sidebar',
-        'content' => 'Content',
         'header' => 'Header',
         'primary_menu' => 'Primary menu',
         'secondary_menu' => 'Secondary menu',
-        'footer' => 'Footer',
-        'highlighted' => 'Highlighted',
-        'help' => 'Help',
         'page_top' => 'Page top',
         'page_bottom' => 'Page bottom',
+        'highlighted' => 'Highlighted',
         'breadcrumb' => 'Breadcrumb',
+        'help' => 'Help',
+        'content' => 'Content',
+        'sidebar_first' => 'Left sidebar',
+        'sidebar_second' => 'Right sidebar',
+        'footer' => 'Footer',
       ),
       'description' => '',
       'features' => $this->defaultFeatures,
diff --git a/core/modules/block/src/Tests/BlockUiTest.php b/core/modules/block/src/Tests/BlockUiTest.php
index 25b7942..5b92556 100644
--- a/core/modules/block/src/Tests/BlockUiTest.php
+++ b/core/modules/block/src/Tests/BlockUiTest.php
@@ -58,14 +58,12 @@ protected function setUp() {
     $this->blockValues = array(
       array(
         'label' => 'Tools',
-        'tr' => '5',
         'plugin_id' => 'system_menu_block:tools',
         'settings' => array('region' => 'sidebar_second', 'id' => 'tools'),
         'test_weight' => '-1',
       ),
       array(
         'label' => 'Powered by Drupal',
-        'tr' => '16',
         'plugin_id' => 'system_powered_by_block',
         'settings' => array('region' => 'footer', 'id' => 'powered'),
         'test_weight' => '0',
@@ -105,8 +103,8 @@ function testBlockAdminUiPage() {
     foreach ($this->blockValues as $delta => $values) {
       $block = $this->blocks[$delta];
       $label = $block->label();
-      $element = $this->xpath('//*[@id="blocks"]/tbody/tr[' . $values['tr'] . ']/td[1]/text()');
-      $this->assertTrue((string) $element[0] == $label, 'The "' . $label . '" block title is set inside the ' . $values['settings']['region'] . ' region.');
+      $element = $this->xpath('//select[@id="edit-blocks-' . $values['settings']['id'] . '-region"]/option[@selected]/@value');
+      $this->assertTrue((string) $element[0] == $values['settings']['region'], 'The "' . $label . '" block title is set inside the ' . $values['settings']['region'] . ' region.');
       // Look for a test block region select form element.
       $this->assertField('blocks[' . $values['settings']['id'] . '][region]', 'The block "' . $values['label'] . '" has a region assignment field.');
       // Move the test block to the header region.
-- 
2.5.0

