Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / config / tests / config_import_test / config_import_test.module
index 6ec1d93d81600c55a8e7fad9cb52943a02c19d0a..d77df0e99f8121a0dc999fde22e006d1279e7583 100644 (file)
@@ -5,6 +5,8 @@
  * Provides configuration import test helpers.
  */
 
+use Drupal\Core\Config\ConfigImporter;
+
 /**
  * Implements hook_config_import_steps_alter().
  */
@@ -17,9 +19,15 @@ function config_import_test_config_import_steps_alter(&$sync_steps) {
  *
  * @param array $context
  *   The batch context.
+ * @param \Drupal\Core\Config\ConfigImporter $config_importer
+ *   The configuration importer.
  */
-function _config_import_test_config_import_steps_alter(&$context) {
+function _config_import_test_config_import_steps_alter(&$context, ConfigImporter $config_importer) {
   $GLOBALS['hook_config_test']['config_import_steps_alter'] = TRUE;
+  if (\Drupal::state()->get('config_import_steps_alter.error', FALSE)) {
+    $context['results']['errors'][] = '_config_import_test_config_import_steps_alter batch error';
+    $config_importer->logError('_config_import_test_config_import_steps_alter ConfigImporter error');
+  }
   $context['finished'] = 1;
   return;
 }