You are here

function _config_test_update_is_syncing_store in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/config/tests/config_test/config_test.hooks.inc \_config_test_update_is_syncing_store()

Helper function for testing hooks during configuration sync.

Parameters

string $hook: The fired hook.

\Drupal\config_test\Entity\ConfigTest $config_test: The ConfigTest entity.

6 calls to _config_test_update_is_syncing_store()
config_test_config_test_create in core/modules/config/tests/config_test/config_test.hooks.inc
Implements hook_ENTITY_TYPE_create() for 'config_test'.
config_test_config_test_delete in core/modules/config/tests/config_test/config_test.hooks.inc
Implements hook_config_test_delete().
config_test_config_test_insert in core/modules/config/tests/config_test/config_test.hooks.inc
Implements hook_config_test_insert().
config_test_config_test_predelete in core/modules/config/tests/config_test/config_test.hooks.inc
Implements hook_config_test_predelete().
config_test_config_test_presave in core/modules/config/tests/config_test/config_test.hooks.inc
Implements hook_config_test_presave().

... See full list

File

core/modules/config/tests/config_test/config_test.hooks.inc, line 79
Fake third-party hook implementations for ConfigTest entities.

Code

function _config_test_update_is_syncing_store($hook, ConfigTest $config_test) {
  $current_value = \Drupal::state()
    ->get('config_test.store_isSyncing', FALSE);
  if ($current_value !== FALSE) {
    $current_value['global_state::' . $hook] = \Drupal::isConfigSyncing();
    $current_value['entity_state::' . $hook] = $config_test
      ->isSyncing();
    \Drupal::state()
      ->set('config_test.store_isSyncing', $current_value);
  }
}