You are here

public function ViewsIntegrationTest::testRelationship in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php \Drupal\Tests\dblog\Kernel\Views\ViewsIntegrationTest::testRelationship()
  2. 9 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);
}