function TaxonomyTermArgumentDepthTest::setUp

Same name in this branch
  1. 10 core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermArgumentDepthTest.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyTermArgumentDepthTest::setUp()
Same name in other branches
  1. 9 core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermArgumentDepthTest.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyTermArgumentDepthTest::setUp()
  2. 9 core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermArgumentDepthTest::setUp()
  3. 8.9.x core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermArgumentDepthTest::setUp()
  4. 11.x core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermArgumentDepthTest.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyTermArgumentDepthTest::setUp()
  5. 11.x core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermArgumentDepthTest::setUp()

Overrides TaxonomyTestBase::setUp

File

core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php, line 47

Class

TaxonomyTermArgumentDepthTest
Tests the taxonomy term with depth argument.

Namespace

Drupal\Tests\taxonomy\Functional\Views

Code

protected function setUp($import_test_views = TRUE, $modules = []) : void {
    parent::setUp($import_test_views, $modules);
    // Create a term with markup in the label.
    $first = $this->createTerm([
        'name' => '<em>First</em>',
    ]);
    // Create a node w/o any terms.
    $settings = [
        'type' => 'article',
    ];
    // Create a node with linked to the term.
    $settings['field_views_testing_tags'][0]['target_id'] = $first->id();
    $this->nodes[] = $this->drupalCreateNode($settings);
    $this->terms[0] = $first;
}

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