public function ViewsIntegrationTest::testRelationship in Drupal 9
Same name and namespace in other branches
- 8 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\ViewsCode
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);
}