You are here

public function ArgumentDateTest::viewsData in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php \Drupal\Tests\views\Kernel\Handler\ArgumentDateTest::viewsData()

Returns the views data definition.

Overrides ViewsKernelTestBase::viewsData

File

core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php, line 35

Class

ArgumentDateTest
Tests the core date argument handlers.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

public function viewsData() {
  $data = parent::viewsData();
  $date_plugins = [
    'date_fulldate',
    'date_day',
    'date_month',
    'date_week',
    'date_year',
    'date_year_month',
  ];
  foreach ($date_plugins as $plugin_id) {
    $data['views_test_data'][$plugin_id] = $data['views_test_data']['created'];
    $data['views_test_data'][$plugin_id]['real field'] = 'created';
    $data['views_test_data'][$plugin_id]['argument']['id'] = $plugin_id;
  }
  return $data;
}