protected function HandlerTest::viewsData

Same name in this branch
  1. 8.x drupal/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php \Drupal\views_ui\Tests\HandlerTest::viewsData()
  2. 8.x drupal/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php \Drupal\views\Tests\Handler\HandlerTest::viewsData()

Overrides Drupal\views\Tests\ViewTestBase::viewsData().

Overrides ViewTestBase::viewsData

1 call to HandlerTest::viewsData()
HandlerTest::testAccess in drupal/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php
Tests access to a handler.

File

drupal/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php, line 50
Definition of Drupal\views\Tests\Handler\HandlerTest.

Class

HandlerTest
Tests abstract handlers of views.

Namespace

Drupal\views\Tests\Handler

Code

protected function viewsData() {
  $data = parent::viewsData();

  // Override the name handler to be able to call placeholder() from outside.
  $data['views_test_data']['name']['field']['id'] = 'test_field';

  // Setup one field with an access callback and one with an access callback
  // and arguments.
  $data['views_test_data']['access_callback'] = $data['views_test_data']['id'];
  $data['views_test_data']['access_callback_arguments'] = $data['views_test_data']['id'];
  foreach (ViewExecutable::viewsHandlerTypes() as $type => $info) {
    if (isset($data['views_test_data']['access_callback'][$type]['id'])) {
      $data['views_test_data']['access_callback'][$type]['access callback'] = 'views_test_data_handler_test_access_callback';
      $data['views_test_data']['access_callback_arguments'][$type]['access callback'] = 'views_test_data_handler_test_access_callback_argument';
      $data['views_test_data']['access_callback_arguments'][$type]['access arguments'] = array(
        TRUE,
      );
    }
  }
  return $data;
}