diff --git a/core/tests/Drupal/KernelTests/Core/Theme/MessageTest.php b/core/tests/Drupal/KernelTests/Core/Theme/MessageTest.php index 5552591ed1..6e594f358e 100644 --- a/core/tests/Drupal/KernelTests/Core/Theme/MessageTest.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/MessageTest.php @@ -21,7 +21,7 @@ class MessageTest extends KernelTestBase { */ public function testMessages() { // Enable the Classy theme. - \Drupal::service('theme_handler')->install(['classy']); + \Drupal::service('theme_installer')->install(['classy']); $this->config('system.theme')->set('default', 'classy')->save(); \Drupal::messenger()->addError('An error occurred'); diff --git a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php index 320e92f46a..ffbe543db7 100644 --- a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php @@ -67,7 +67,7 @@ public function testRaceCondition() { */ public function testMultipleSubThemes() { $theme_handler = \Drupal::service('theme_handler'); - $theme_handler->install(['test_basetheme', 'test_subtheme', 'test_subsubtheme']); + \Drupal::service('theme_installer')->install(['test_basetheme', 'test_subtheme', 'test_subsubtheme']); $registry_subsub_theme = new Registry($this->root, \Drupal::cache(), \Drupal::lock(), \Drupal::moduleHandler(), $theme_handler, \Drupal::service('theme.initialization'), 'test_subsubtheme'); $registry_subsub_theme->setThemeManager(\Drupal::theme()); @@ -109,7 +109,7 @@ public function testMultipleSubThemes() { */ public function testSuggestionPreprocessFunctions() { $theme_handler = \Drupal::service('theme_handler'); - $theme_handler->install(['test_theme']); + \Drupal::service('theme_installer')->install(['test_theme']); $registry_theme = new Registry($this->root, \Drupal::cache(), \Drupal::lock(), \Drupal::moduleHandler(), $theme_handler, \Drupal::service('theme.initialization'), 'test_theme'); $registry_theme->setThemeManager(\Drupal::theme()); @@ -151,7 +151,7 @@ public function testThemeRegistryAlterByTheme() { /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */ $theme_handler = \Drupal::service('theme_handler'); - $theme_handler->install(['test_theme']); + \Drupal::service('theme_installer')->install(['test_theme']); $this->config('system.theme')->set('default', 'test_theme')->save(); $registry = new Registry($this->root, \Drupal::cache(), \Drupal::lock(), \Drupal::moduleHandler(), $theme_handler, \Drupal::service('theme.initialization'), 'test_theme'); @@ -197,7 +197,7 @@ public function testThemeSuggestions() { */ public function testThemeTemplatesRegisteredByModules() { $theme_handler = \Drupal::service('theme_handler'); - $theme_handler->install(['test_theme']); + \Drupal::service('theme_installer')->install(['test_theme']); $registry_theme = new Registry($this->root, \Drupal::cache(), \Drupal::lock(), \Drupal::moduleHandler(), $theme_handler, \Drupal::service('theme.initialization'), 'test_theme'); $registry_theme->setThemeManager(\Drupal::theme()); diff --git a/core/tests/Drupal/KernelTests/Core/Theme/StableThemeTest.php b/core/tests/Drupal/KernelTests/Core/Theme/StableThemeTest.php index 8a79a9eff4..50e732631d 100644 --- a/core/tests/Drupal/KernelTests/Core/Theme/StableThemeTest.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/StableThemeTest.php @@ -19,11 +19,11 @@ class StableThemeTest extends KernelTestBase { public static $modules = ['system']; /** - * The theme handler. + * The theme installer. * - * @var \Drupal\Core\Extension\ThemeHandlerInterface + * @var \Drupal\Core\Extension\ThemeInstallerInterface */ - protected $themeHandler; + protected $themeInstaller; /** * The theme manager. @@ -38,7 +38,7 @@ class StableThemeTest extends KernelTestBase { protected function setUp() { parent::setUp(); - $this->themeHandler = $this->container->get('theme_handler'); + $this->themeInstaller = $this->container->get('theme_installer'); $this->themeManager = $this->container->get('theme.manager'); } @@ -46,7 +46,7 @@ protected function setUp() { * Ensures Stable is used by default when no base theme has been defined. */ public function testStableIsDefault() { - $this->themeHandler->install(['test_stable']); + $this->themeInstaller->install(['test_stable']); $this->config('system.theme')->set('default', 'test_stable')->save(); $theme = $this->themeManager->getActiveTheme(); /** @var \Drupal\Core\Theme\ActiveTheme $base_theme */ @@ -59,7 +59,7 @@ public function testStableIsDefault() { * Tests opting out of Stable by setting the base theme to false. */ public function testWildWest() { - $this->themeHandler->install(['test_wild_west']); + $this->themeInstaller->install(['test_wild_west']); $this->config('system.theme')->set('default', 'test_wild_west')->save(); $theme = $this->themeManager->getActiveTheme(); /** @var \Drupal\Core\Theme\ActiveTheme $base_theme */ diff --git a/core/tests/Drupal/KernelTests/Core/Theme/ThemeSettingsTest.php b/core/tests/Drupal/KernelTests/Core/Theme/ThemeSettingsTest.php index cf0e7d2c21..9e70d19559 100644 --- a/core/tests/Drupal/KernelTests/Core/Theme/ThemeSettingsTest.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/ThemeSettingsTest.php @@ -45,7 +45,7 @@ public function testDefaultConfig() { $name = 'test_basetheme'; $path = $this->availableThemes[$name]->getPath(); $this->assertTrue(file_exists("$path/" . InstallStorage::CONFIG_INSTALL_DIRECTORY . "/$name.settings.yml")); - $this->container->get('theme_handler')->install([$name]); + $this->container->get('theme_installer')->install([$name]); $this->assertIdentical(theme_get_setting('base', $name), 'only'); } @@ -56,7 +56,7 @@ public function testNoDefaultConfig() { $name = 'stark'; $path = $this->availableThemes[$name]->getPath(); $this->assertFalse(file_exists("$path/" . InstallStorage::CONFIG_INSTALL_DIRECTORY . "/$name.settings.yml")); - $this->container->get('theme_handler')->install([$name]); + $this->container->get('theme_installer')->install([$name]); $this->assertNotNull(theme_get_setting('features.favicon', $name)); } @@ -64,9 +64,11 @@ public function testNoDefaultConfig() { * Tests that the default logo config can be overridden. */ public function testLogoConfig() { + /** @var \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer */ + $theme_installer = $this->container->get('theme_installer'); + $theme_installer->install(['stark']); /** @var \Drupal\Core\Extension\ThemeHandler $theme_handler */ $theme_handler = $this->container->get('theme_handler'); - $theme_handler->install(['stark']); $theme = $theme_handler->getTheme('stark'); // Tests default behaviour. @@ -98,7 +100,7 @@ public function testLogoConfig() { $expected = '/' . $theme->getPath() . '/logo_relative_path.gif'; $this->assertEquals($expected, theme_get_setting('logo.url', 'stark')); - $theme_handler->install(['test_theme']); + $theme_installer->install(['test_theme']); $theme_handler->setDefault('test_theme'); $theme = $theme_handler->getTheme('test_theme');