function RelationshipNodeTermDataTest::assertQueriesTermAccessTag
Same name and namespace in other branches
- 11.x core/modules/taxonomy/tests/src/Kernel/Views/RelationshipNodeTermDataTest.php \Drupal\Tests\taxonomy\Kernel\Views\RelationshipNodeTermDataTest::assertQueriesTermAccessTag()
- 10 core/modules/taxonomy/tests/src/Kernel/Views/RelationshipNodeTermDataTest.php \Drupal\Tests\taxonomy\Kernel\Views\RelationshipNodeTermDataTest::assertQueriesTermAccessTag()
- 9 core/modules/taxonomy/tests/src/Functional/Views/RelationshipNodeTermDataTest.php \Drupal\Tests\taxonomy\Functional\Views\RelationshipNodeTermDataTest::assertQueriesTermAccessTag()
- main core/modules/taxonomy/tests/src/Kernel/Views/RelationshipNodeTermDataTest.php \Drupal\Tests\taxonomy\Kernel\Views\RelationshipNodeTermDataTest::assertQueriesTermAccessTag()
Assert views queries have taxonomy_term_access tag.
Parameters
\Drupal\views\ViewExecutable $view: The View to check for the term access tag.
bool $hasTag: The expected existence of taxonomy_term_access tag.
1 call to RelationshipNodeTermDataTest::assertQueriesTermAccessTag()
- RelationshipNodeTermDataTest::testTag in core/
modules/ taxonomy/ tests/ src/ Functional/ Views/ RelationshipNodeTermDataTest.php - Tests that the 'taxonomy_term_access' tag is added to the Views query.
File
-
core/
modules/ taxonomy/ tests/ src/ Functional/ Views/ RelationshipNodeTermDataTest.php, line 98
Class
- RelationshipNodeTermDataTest
- Tests the taxonomy term on node relationship handler.
Namespace
Drupal\Tests\taxonomy\Functional\ViewsCode
protected function assertQueriesTermAccessTag(ViewExecutable $view, $hasTag) {
$main_query = $view->build_info['query'];
$count_query = $view->build_info['count_query'];
foreach ([
$main_query,
$count_query,
] as $query) {
$tables = $query->getTables();
foreach ($tables as $join_table) {
if (is_object($join_table['table'])) {
$this->assertSame($join_table['table']->hasTag('taxonomy_term_access'), $hasTag);
}
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.