function RegistryTest::testLegacyThemeRegistryRebuild
Tests deprecated drupal_theme_rebuild() function.
@group legacy
See also
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Theme/ RegistryTest.php, line 284
Class
- RegistryTest
- Tests the behavior of the ThemeRegistry class.
Namespace
Drupal\KernelTests\Core\ThemeCode
public function testLegacyThemeRegistryRebuild() : void {
$registry = \Drupal::service('theme.registry');
$runtime = $registry->getRuntime();
$hooks = $registry->get();
$this->expectDeprecation('drupal_theme_rebuild() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use theme.registry service reset() method instead. See https://www.drupal.org/node/3348853');
drupal_theme_rebuild();
$this->assertNotSame($runtime, $registry->getRuntime());
$this->assertSame($hooks, $registry->get());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.