function ModuleRequiredByThemesUninstallValidatorTest::testValidateOneThemeDependency
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php \Drupal\Tests\Core\Extension\ModuleRequiredByThemesUninstallValidatorTest::testValidateOneThemeDependency()
- 8.9.x core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php \Drupal\Tests\Core\Extension\ModuleRequiredByThemesUninstallValidatorTest::testValidateOneThemeDependency()
- 11.x core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php \Drupal\Tests\Core\Extension\ModuleRequiredByThemesUninstallValidatorTest::testValidateOneThemeDependency()
@covers ::validate
File
-
core/
tests/ Drupal/ Tests/ Core/ Extension/ ModuleRequiredByThemesUninstallValidatorTest.php, line 73
Class
- ModuleRequiredByThemesUninstallValidatorTest
- @coversDefaultClass \Drupal\Core\Extension\ModuleRequiredByThemesUninstallValidator @group Extension
Namespace
Drupal\Tests\Core\ExtensionCode
public function testValidateOneThemeDependency() : void {
$module = 'single_module';
$module_name = 'Single Module';
$theme = 'one_theme';
$theme_name = 'One Theme';
$this->themeExtensionList
->getAllInstalledInfo()
->willReturn([
'stable9' => [
'name' => 'Stable 9',
'dependencies' => [],
],
'claro' => [
'name' => 'Claro',
'dependencies' => [],
],
$theme => [
'name' => $theme_name,
'dependencies' => [
$module,
],
],
]);
$this->moduleExtensionList
->get($module)
->willReturn((object) [
'info' => [
'name' => $module_name,
],
]);
$expected = [
"Required by the theme: {$theme_name}",
];
$reasons = $this->moduleRequiredByThemeUninstallValidator
->validate($module);
$this->assertEquals($expected, $reasons);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.