function TaxonomyTermArgumentTidFromNodeTest::setUp

Same name and namespace in other branches
  1. 11.x core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentTidFromNodeTest.php \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermArgumentTidFromNodeTest::setUp()

Overrides TaxonomyTestBase::setUp

File

core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentTidFromNodeTest.php, line 41

Class

TaxonomyTermArgumentTidFromNodeTest
Tests the taxonomy term with argument from a node page.

Namespace

Drupal\Tests\taxonomy\Functional\Views

Code

protected function setUp($import_test_views = TRUE, $modules = []) : void {
  parent::setUp($import_test_views, $modules);
  // Remove the term field from the display, replace with the view.
  /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
  $display_repository = \Drupal::service('entity_display.repository');
  $display_repository->getViewDisplay('node', 'article')
    ->removeComponent('field_views_testing_tags')
    ->save();
  $this->drupalPlaceBlock('views_block:test_argument_tid_from_node-block_1');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.