/**
* Tests config imports that install and uninstall a theme with dependencies.
*/
public function testConfigImportWithThemeWithModuleDependencies() { $this->container->
get('module_installer'
)->
install(['test_module_required_by_theme', 'test_another_module_required_by_theme'
]);
$this->container->
get('theme_installer'
)->
install(['test_theme_depending_on_modules'
]);
$this->
assertTrue($this->container->
get('theme_handler'
)->
themeExists('test_theme_depending_on_modules'
), 'test_theme_depending_on_modules theme installed'
);
$sync =
$this->container->
get('config.storage.sync'
);
$this->
copyConfig($this->container->
get('config.storage'
),
$sync);
$extensions =
$sync->
read('core.extension'
);
// Remove one of the modules the theme depends on.
unset($extensions['module'
]['test_module_required_by_theme'
]);
$sync->
write('core.extension',
$extensions);
try { $this->
configImporter()->
validate();
$this->
fail('ConfigImporterException not thrown; an invalid import was not stopped due to missing dependencies.'
);
} catch (ConfigImporterException
$e) { $error_message = 'Unable to uninstall the <em class="placeholder">Test Module Required by Theme</em> module because: Required by the theme: Test Theme Depending on Modules.';