/**
* Tests the theme registry with multiple subthemes.
*/
public function testMultipleSubThemes() { $theme_handler = \Drupal::
service('theme_handler'
);
\Drupal::
service('theme_installer'
)->
install(['test_basetheme', 'test_subtheme', 'test_subsubtheme'
]);
$module_list =
$this->container->
get('extension.list.module'
);
assert($module_list instanceof ModuleExtensionList
);
$registry_subsub_theme =
new Registry($this->root, \Drupal::
cache(), \Drupal::
lock(), \Drupal::
moduleHandler(),
$theme_handler, \Drupal::
service('theme.initialization'
), \Drupal::
service('cache.bootstrap'
),
$module_list, 'test_subsubtheme'
);
$registry_subsub_theme->
setThemeManager(\Drupal::
theme());
$registry_sub_theme =
new Registry($this->root, \Drupal::
cache(), \Drupal::
lock(), \Drupal::
moduleHandler(),
$theme_handler, \Drupal::
service('theme.initialization'
), \Drupal::
service('cache.bootstrap'
),
$module_list, 'test_subtheme'
);
$registry_sub_theme->
setThemeManager(\Drupal::
theme());
$registry_base_theme =
new Registry($this->root, \Drupal::
cache(), \Drupal::
lock(), \Drupal::
moduleHandler(),
$theme_handler, \Drupal::
service('theme.initialization'
), \Drupal::
service('cache.bootstrap'
),
$module_list, 'test_basetheme'
);
$registry_base_theme->
setThemeManager(\Drupal::
theme());
$preprocess_functions =
$registry_subsub_theme->
get()['theme_test_template_test'
]['preprocess functions'
];
$this->
assertSame([ 'template_preprocess',
'test_basetheme_preprocess_theme_test_template_test',
'test_subtheme_preprocess_theme_test_template_test',