diff --git a/core/modules/block/src/Tests/BlockHiddenRegionTest.php b/core/modules/block/src/Tests/BlockHiddenRegionTest.php index a6af2ce..bb42dce 100644 --- a/core/modules/block/src/Tests/BlockHiddenRegionTest.php +++ b/core/modules/block/src/Tests/BlockHiddenRegionTest.php @@ -56,7 +56,9 @@ public function testBlockNotInHiddenRegion() { // Install "block_test_theme" and set it as the default theme. $theme = 'block_test_theme'; - \Drupal::service('theme_handler')->install(array($theme)); + // We need to install a non-hidden theme so that there is more than one + // local task. + \Drupal::service('theme_handler')->install(array($theme, 'stark')); $this->config('system.theme') ->set('default', $theme) ->save(); diff --git a/core/modules/block/src/Tests/BlockTest.php b/core/modules/block/src/Tests/BlockTest.php index c98b042..261c3ae 100644 --- a/core/modules/block/src/Tests/BlockTest.php +++ b/core/modules/block/src/Tests/BlockTest.php @@ -197,9 +197,9 @@ function testBlock() { */ public function testBlockThemeSelector() { // Install all themes. - \Drupal::service('theme_handler')->install(array('bartik', 'seven')); + \Drupal::service('theme_handler')->install(['bartik', 'seven', 'stark']); $theme_settings = $this->config('system.theme'); - foreach (array('bartik', 'classy', 'seven') as $theme) { + foreach (['bartik', 'seven', 'stark'] as $theme) { $this->drupalGet('admin/structure/block/list/' . $theme); $this->assertTitle(t('Block layout') . ' | Drupal'); // Select the 'Powered by Drupal' block to be placed. diff --git a/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php b/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php index f70a57c..6320917 100644 --- a/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php +++ b/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php @@ -27,7 +27,11 @@ protected function setUp() { $themes = array(); $themes['test_a'] = (object) array( - 'status' => 0, + 'status' => 1, + 'info' => array( + 'name' => 'test_a', + 'hidden' => TRUE, + ), ); $themes['test_b'] = (object) array( 'status' => 1, @@ -45,6 +49,13 @@ protected function setUp() { $theme_handler->expects($this->any()) ->method('listInfo') ->will($this->returnValue($themes)); + $theme_handler->expects($this->any()) + ->method('hasUi') + ->willReturnMap([ + ['test_a', FALSE], + ['test_b', TRUE], + ['test_c', TRUE], + ]); $container = new ContainerBuilder(); $container->set('config.factory', $config_factory); diff --git a/core/modules/block_content/src/Tests/BlockContentTypeTest.php b/core/modules/block_content/src/Tests/BlockContentTypeTest.php index e669a72..d1405b9 100644 --- a/core/modules/block_content/src/Tests/BlockContentTypeTest.php +++ b/core/modules/block_content/src/Tests/BlockContentTypeTest.php @@ -185,17 +185,15 @@ public function testsBlockContentAddTypes() { ->getStorage('block_content'); // Install all themes. - \Drupal::service('theme_handler')->install(array('bartik', 'seven')); - $themes = array('bartik', 'seven', 'classy'); + \Drupal::service('theme_handler')->install(['bartik', 'seven', 'stark']); $theme_settings = $this->config('system.theme'); - foreach ($themes as $default_theme) { + foreach (['bartik', 'seven', 'stark'] as $default_theme) { // Change the default theme. $theme_settings->set('default', $default_theme)->save(); \Drupal::service('router.builder')->rebuild(); // For each installed theme, go to its block page and test the redirects. - $themes = array('bartik', 'classy', 'seven'); - foreach ($themes as $theme) { + foreach (['bartik', 'seven', 'stark'] as $theme) { // Test that adding a block from the 'place blocks' form sends you to the // block configure form. $path = $theme == $default_theme ? 'admin/structure/block' : "admin/structure/block/list/$theme";