function ArgumentDateTest::viewsData

Same name in other branches
  1. 9 core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php \Drupal\Tests\views\Kernel\Handler\ArgumentDateTest::viewsData()
  2. 8.9.x core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php \Drupal\Tests\views\Kernel\Handler\ArgumentDateTest::viewsData()
  3. 11.x core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php \Drupal\Tests\views\Kernel\Handler\ArgumentDateTest::viewsData()

Overrides ViewsKernelTestBase::viewsData

File

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

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;
}

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