You are here

protected function HandlerTest::viewsData in Drupal 10

Same name in this branch
  1. 10 core/modules/views_ui/tests/src/Functional/HandlerTest.php \Drupal\Tests\views_ui\Functional\HandlerTest::viewsData()
  2. 10 core/modules/views/tests/src/Functional/Handler/HandlerTest.php \Drupal\Tests\views\Functional\Handler\HandlerTest::viewsData()
Same name and namespace in other branches
  1. 8 core/modules/views_ui/tests/src/Functional/HandlerTest.php \Drupal\Tests\views_ui\Functional\HandlerTest::viewsData()
  2. 9 core/modules/views_ui/tests/src/Functional/HandlerTest.php \Drupal\Tests\views_ui\Functional\HandlerTest::viewsData()

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

Adds:

  • a relationship for the uid column.
  • a dummy field with no help text.

File

core/modules/views_ui/tests/src/Functional/HandlerTest.php, line 73

Class

HandlerTest
Tests handler UI for views.

Namespace

Drupal\Tests\views_ui\Functional

Code

protected function viewsData() {
  $data = parent::viewsData();
  $data['views_test_data']['uid'] = [
    'title' => 'UID',
    'help' => 'The test data UID',
    'relationship' => [
      'id' => 'standard',
      'base' => 'users_field_data',
      'base field' => 'uid',
    ],
  ];

  // Create a dummy field with no help text.
  $data['views_test_data']['no_help'] = $data['views_test_data']['name'];
  $data['views_test_data']['no_help']['field']['title'] = 'No help';
  $data['views_test_data']['no_help']['field']['real field'] = 'name';
  unset($data['views_test_data']['no_help']['help']);
  return $data;
}