function RelationshipJoinInTest::viewsData

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinInTest.php \Drupal\Tests\views\Kernel\Plugin\RelationshipJoinInTest::viewsData()
  2. 8.9.x core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinInTest.php \Drupal\Tests\views\Kernel\Plugin\RelationshipJoinInTest::viewsData()
  3. 10 core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinInTest.php \Drupal\Tests\views\Kernel\Plugin\RelationshipJoinInTest::viewsData()

Adds an IN condition for the user name.

Overrides RelationshipJoinTestBase::viewsData

File

core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinInTest.php, line 141

Class

RelationshipJoinInTest
Tests the base relationship handler.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

protected function viewsData() {
    $data = parent::viewsData();
    // Only relate if the author's name is Kristiaan or Silvie.
    $data['views_test_data']['uid']['relationship']['extra'][] = [
        'field' => 'name',
        'value' => [
            'Kristiaan',
            'Silvie',
        ],
    ];
    return $data;
}

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