5 * Provides configuration import test helpers.
8 use Drupal\Core\Config\ConfigImporter;
11 * Implements hook_config_import_steps_alter().
13 function config_import_test_config_import_steps_alter(&$sync_steps) {
14 $sync_steps[] = '_config_import_test_config_import_steps_alter';
18 * Implements configuration synchronization step added by an alter for testing.
20 * @param array $context
22 * @param \Drupal\Core\Config\ConfigImporter $config_importer
23 * The configuration importer.
25 function _config_import_test_config_import_steps_alter(&$context, ConfigImporter $config_importer) {
26 $GLOBALS['hook_config_test']['config_import_steps_alter'] = TRUE;
27 if (\Drupal::state()->get('config_import_steps_alter.error', FALSE)) {
28 $context['results']['errors'][] = '_config_import_test_config_import_steps_alter batch error';
29 $config_importer->logError('_config_import_test_config_import_steps_alter ConfigImporter error');
31 $context['finished'] = 1;