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
1 <?php
2
3 /**
4  * @file
5  * Provides configuration import test helpers.
6  */
7
8 use Drupal\Core\Config\ConfigImporter;
9
10 /**
11  * Implements hook_config_import_steps_alter().
12  */
13 function config_import_test_config_import_steps_alter(&$sync_steps) {
14   $sync_steps[] = '_config_import_test_config_import_steps_alter';
15 }
16
17 /**
18  * Implements configuration synchronization step added by an alter for testing.
19  *
20  * @param array $context
21  *   The batch context.
22  * @param \Drupal\Core\Config\ConfigImporter $config_importer
23  *   The configuration importer.
24  */
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');
30   }
31   $context['finished'] = 1;
32   return;
33 }