You are here

public function TaxonomyTermArgumentDepthTest::setUp in Zircon Profile 8

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

Sets up a Drupal site for running functional and integration tests.

Installs Drupal with the installation profile specified in \Drupal\simpletest\WebTestBase::$profile into the prefixed database.

Afterwards, installs any additional modules specified in the static \Drupal\simpletest\WebTestBase::$modules property of each class in the class hierarchy.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

Overrides TaxonomyTestBase::setUp

File

core/modules/taxonomy/src/Tests/Views/TaxonomyTermArgumentDepthTest.php, line 40
Contains \Drupal\taxonomy\Tests\Views\TaxonomyTermArgumentDepthTest.

Class

TaxonomyTermArgumentDepthTest
Tests the taxonomy term with depth argument.

Namespace

Drupal\taxonomy\Tests\Views

Code

public function setUp() {
  parent::setUp();

  // 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;
}