function ViewsIntegrationTest::testRelationship

Same name in other branches
  1. 8.9.x core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php \Drupal\Tests\dblog\Kernel\Views\ViewsIntegrationTest::testRelationship()
  2. 10 core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php \Drupal\Tests\dblog\Kernel\Views\ViewsIntegrationTest::testRelationship()
  3. 11.x core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php \Drupal\Tests\dblog\Kernel\Views\ViewsIntegrationTest::testRelationship()

Tests the relationship with the users_field_data table.

File

core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php, line 94

Class

ViewsIntegrationTest
Tests the views integration of dblog module.

Namespace

Drupal\Tests\dblog\Kernel\Views

Code

public function testRelationship() {
    $view = Views::getView('dblog_integration_test');
    $view->setDisplay('page_1');
    // The uid relationship should now join to the {users_field_data} table.
    $base_tables = $view->getBaseTables();
    $this->assertArrayHasKey('users_field_data', $base_tables);
    $this->assertArrayNotHasKey('users', $base_tables);
    $this->assertArrayHasKey('watchdog', $base_tables);
}

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