You are here

protected function TaxonomyEntityIndexTermFilterDepthTest::assertTermWithDepthResult in Taxonomy Entity Index 8

Changes the filter to a given term and depth and then asserts the results.

Parameters

int $tid: The term ID to filter on.

int $depth: The depth to search.

array $expected: The expected views result.

1 call to TaxonomyEntityIndexTermFilterDepthTest::assertTermWithDepthResult()
TaxonomyEntityIndexTermFilterDepthTest::testTermWithDepthFilter in tests/src/Functional/Views/TaxonomyEntityIndexTermFilterDepthTest.php
Tests the terms with depth filter.

File

tests/src/Functional/Views/TaxonomyEntityIndexTermFilterDepthTest.php, line 135

Class

TaxonomyEntityIndexTermFilterDepthTest
Test the taxonomy term with depth filter.

Namespace

Drupal\Tests\taxonomy_entity_index\Functional\Views

Code

protected function assertTermWithDepthResult($tid, $depth, array $expected) {
  $this->view
    ->destroy();
  $this->view
    ->initDisplay();
  $filters = $this->view->displayHandlers
    ->get('default')
    ->getOption('filters');
  $filters['tid_depth']['depth'] = $depth;
  $filters['tid_depth']['value'] = [
    $tid,
  ];
  $this->view->displayHandlers
    ->get('default')
    ->setOption('filters', $filters);
  $this
    ->executeView($this->view);
  $this
    ->assertIdenticalResultsetHelper($this->view, $expected, [
    'nid' => 'nid',
  ], 'assertIdentical');
}