5 * Module file for workflow_type_test.
9 * Implements hook_workflow_type_info_alter().
11 function workflow_type_test_workflow_type_info_alter(&$definitions) {
12 // Allow tests to override the workflow type definitions.
13 $state = \Drupal::state();
14 if ($state->get('workflow_type_test.plugin_definitions') !== NULL) {
15 $definitions = $state->get('workflow_type_test.plugin_definitions');
20 * Sets the type plugin definitions override and clear the cache.
22 * @param array $definitions
25 function workflow_type_test_set_definitions($definitions) {
26 \Drupal::state()->set('workflow_type_test.plugin_definitions', $definitions);
27 \Drupal::service('plugin.manager.workflows.type')->clearCachedDefinitions();