Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 296020

ConfigImportAllTest should not make any assumptions about what modules/entity types exist in core

$
0
0

Problem/Motivation

Removing the Workspaces module for the 8.6.0 alpha broke HEAD, because of this workaround code in ConfigImportAllTest:

    // Delete all terms.                                                        
    $terms = Term::loadMultiple();
    entity_delete_multiple('taxonomy_term', array_keys($terms));

    // Delete all filter formats.                                               
    $filters = FilterFormat::loadMultiple();
    entity_delete_multiple('filter_format', array_keys($filters));

    // Delete any shortcuts so the shortcut module can be uninstalled.          
    $shortcuts = Shortcut::loadMultiple();
    entity_delete_multiple('shortcut', array_keys($shortcuts));

    // Delete any workspaces so the workspace module can be uninstalled.        
    $workspaces = Workspace::loadMultiple();
    \Drupal::entityTypeManager()->getStorage('workspace')->delete($workspaces);

There is also this a few lines later:

    $this->assertTrue(isset($modules_to_uninstall['comment']), 'The comment module will be disabled');
    $this->assertTrue(isset($modules_to_uninstall['file']), 'The File module will be disabled');
    $this->assertTrue(isset($modules_to_uninstall['editor']), 'The Editor module will be disabled');

Ideally we would not hardcode the existence of any particular optional module in the config import test. In particular, there should not be references to experimental modules outside that module's directory.

Proposed resolution

TBD

Remaining tasks

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 296020

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>