views_test_data.module

File

core/modules/views/tests/modules/views_test_data/views_test_data.module

View source
<?php


/**
 * @file
 * Helper module for Views tests.
 */

declare (strict_types=1);

/**
 * Access callback for the generic handler test.
 *
 * @return bool
 *   Returns views_test_data.tests->handler_access_callback config. so the user
 *   has access to the handler.
 *
 * @see \Drupal\views\Tests\Handler\HandlerTest
 */
function views_test_data_handler_test_access_callback() {
  return \Drupal::config('views_test_data.tests')->get('handler_access_callback');
}

/**
 * Access callback with an argument for the generic handler test.
 *
 * @param bool $argument
 *   A parameter to test that an argument got passed.
 *
 * @return bool
 *   Returns views_test_data.tests->handler_access_callback_argument, so the
 *   use has access to the handler.
 *
 * @see \Drupal\views\Tests\Handler\HandlerTest
 */
function views_test_data_handler_test_access_callback_argument($argument = FALSE) {
  // Check the argument to be sure that access arguments are passed into the
  // callback.
  if ($argument) {
    return \Drupal::config('views_test_data.tests')->get('handler_access_callback_argument');
  }
  else {
    return FALSE;
  }
}

Functions

Title Deprecated Summary
views_test_data_handler_test_access_callback Access callback for the generic handler test.
views_test_data_handler_test_access_callback_argument Access callback with an argument for the generic handler test.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.