function TaxonomyTermFilterDepthTest::assertTermWithDepthResult
Same name in other branches
- 9 core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermFilterDepthTest.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyTermFilterDepthTest::assertTermWithDepthResult()
- 9 core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermFilterDepthTest.php \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermFilterDepthTest::assertTermWithDepthResult()
- 8.9.x core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermFilterDepthTest.php \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermFilterDepthTest::assertTermWithDepthResult()
- 11.x core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermFilterDepthTest.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyTermFilterDepthTest::assertTermWithDepthResult()
Asserts the result of the view for the given filter configuration.
@internal
Parameters
array $expected: The expected views result.
int|int[] $tid: The term ID or IDs to filter on.
int $depth: The depth to search.
1 call to TaxonomyTermFilterDepthTest::assertTermWithDepthResult()
- TaxonomyTermFilterDepthTest::testTermWithDepthFilter in core/
modules/ taxonomy/ tests/ src/ Kernel/ Views/ TaxonomyTermFilterDepthTest.php - Tests the terms with depth filter.
File
-
core/
modules/ taxonomy/ tests/ src/ Kernel/ Views/ TaxonomyTermFilterDepthTest.php, line 163
Class
- TaxonomyTermFilterDepthTest
- Test the taxonomy term with depth filter.
Namespace
Drupal\Tests\taxonomy\Kernel\ViewsCode
protected function assertTermWithDepthResult(array $expected, $tid, int $depth) : void {
$this->view
->destroy();
$this->view
->initDisplay();
$filters = $this->view->displayHandlers
->get('default')
->getOption('filters');
$filters['tid_depth']['depth'] = $depth;
$filters['tid_depth']['value'] = (array) $tid;
$this->view->displayHandlers
->get('default')
->setOption('filters', $filters);
$this->executeView($this->view);
$this->assertIdenticalResultsetHelper($this->view, $expected, [
'nid' => 'nid',
], 'assertIdentical');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.