diff -u b/core/modules/system/src/Controller/ThemeController.php b/core/modules/system/src/Controller/ThemeController.php --- b/core/modules/system/src/Controller/ThemeController.php +++ b/core/modules/system/src/Controller/ThemeController.php @@ -7,7 +7,6 @@ use Drupal\Core\Config\UnmetDependenciesException; use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Extension\ThemeHandlerInterface; -use Drupal\Core\Messenger\MessengerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; @@ -25,26 +24,16 @@ protected $themeHandler; /** - * The messenger. - * - * @var \Drupal\Core\Messenger\MessengerInterface - */ - protected $messenger; - - /** * Constructs a new ThemeController. * * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler * The theme handler. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The config factory. - * @param \Drupal\Core\Messenger\MessengerInterface $messenger - * The messenger. */ - public function __construct(ThemeHandlerInterface $theme_handler, ConfigFactoryInterface $config_factory, MessengerInterface $messenger) { + public function __construct(ThemeHandlerInterface $theme_handler, ConfigFactoryInterface $config_factory) { $this->themeHandler = $theme_handler; $this->configFactory = $config_factory; - $this->messenger = $messenger; } /** @@ -53,8 +42,7 @@ public static function create(ContainerInterface $container) { return new static( $container->get('theme_handler'), - $container->get('config.factory'), - $container->get('messenger') + $container->get('config.factory') ); } diff -u b/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php --- b/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php +++ b/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php @@ -46,6 +46,19 @@ } /** + * Tests installing a theme with existing module dependencies. + */ + public function testInstallModuleWithAlreadyInstalledDependencies() { + $this->drupalGet('admin/appearance'); + $themeXpath = '//h3[contains(text(), "test theme depending on already installed module")]'; + $elements = $this->xpath($themeXpath); + $this->assertCount(1, $elements); + $this->getSession()->getDriver()->click('//h3[contains(text(), "test theme depending on already installed module")]/../ul/li[1]/a'); + $this->assertSession()->addressEquals('admin/appearance'); + $this->assertSession()->pageTextContains('The test theme depending on already installed module theme has been installed.'); + } + + /** * Tests installing a theme with missing module dependencies. */ public function testInstallModuleWithMissingDependencies() { only in patch2: unchanged: --- /dev/null +++ b/core/modules/system/tests/themes/test_theme_depending_on_already_installed_module/test_theme_depending_on_already_installed_module.info.yml @@ -0,0 +1,5 @@ +name: test theme depending on already installed module +type: theme +core: 8.x +dependencies: + - node