public function ModuleRequiredByThemesUninstallValidatorTest::testValidateOneThemeDependency in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php \Drupal\Tests\Core\Extension\ModuleRequiredByThemesUninstallValidatorTest::testValidateOneThemeDependency()
- 10 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 74
Class
- ModuleRequiredByThemesUninstallValidatorTest
- @coversDefaultClass \Drupal\Core\Extension\ModuleRequiredByThemesUninstallValidator @group Extension
Namespace
Drupal\Tests\Core\ExtensionCode
public function testValidateOneThemeDependency() {
$module = 'single_module';
$module_name = 'Single Module';
$theme = 'one_theme';
$theme_name = 'One Theme';
$this->themeExtensionList
->getAllInstalledInfo()
->willReturn([
'stable' => [
'name' => 'Stable',
'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
->assertSame($expected, $this
->castSafeStrings($reasons));
}