You are here

protected function TaxonomyTermFilterDepthTest::assertTermWithDepthResult in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/taxonomy/src/Tests/Views/TaxonomyTermFilterDepthTest.php \Drupal\taxonomy\Tests\Views\TaxonomyTermFilterDepthTest::assertTermWithDepthResult()

Changes the tid filter to given term and depth.

Parameters

integer $tid: The term ID to filter on.

integer $depth: The depth to search.

array $expected: The expected views result.

1 call to TaxonomyTermFilterDepthTest::assertTermWithDepthResult()
TaxonomyTermFilterDepthTest::testTermWithDepthFilter in core/modules/taxonomy/src/Tests/Views/TaxonomyTermFilterDepthTest.php
Tests the terms with depth filter.

File

core/modules/taxonomy/src/Tests/Views/TaxonomyTermFilterDepthTest.php, line 128
Contains \Drupal\taxonomy\Tests\Views\TaxonomyTermFilterDepthTest.

Class

TaxonomyTermFilterDepthTest
Test the taxonomy term with depth filter.

Namespace

Drupal\taxonomy\Tests\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');
}