You are here

little_helpers_test.module in Little helpers 7.2

Test hook implementations.

File

little_helpers_test/little_helpers_test.module
View source
<?php

use Drupal\little_helpers\Services\Container;
use Drupal\little_helpers\System\FormRedirect;
use Drupal\little_helpers\Webform\Submission;

/**
 * Test hook implementations.
 * @file
 */

/**
 * Implements hook_webform_redirect_alter().
 */
function little_helpers_test_webform_redirect_alter(FormRedirect $redirect, Submission $submission = NULL) {
  $redirect->query['test'] = 'foo';
  $redirect->fragment .= 'bar';
}

/**
 * Implements hook_webform_submission_confirmed().
 */
function little_helpers_test_webform_submission_confirmed(Submission $submission) {
  $submission->confirmed_hook_called = TRUE;
}

/**
 * Implements hook_little_helpers_services().
 */
function little_helpers_test_little_helpers_services() {
  $info['little_helpers_test.loader'] = [
    'class' => Container::class,
    'calls' => [
      [
        'loadSpecsFromHook',
        [
          'little_helpers_test_plugins',
        ],
      ],
    ],
  ];
  return $info;
}