function TaxonomyTestBase::setUp

Same name in this branch
  1. 8.9.x core/modules/taxonomy/src/Tests/TaxonomyTestBase.php \Drupal\taxonomy\Tests\TaxonomyTestBase::setUp()
  2. 8.9.x core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyTestBase::setUp()
  3. 8.9.x core/modules/taxonomy/tests/src/Functional/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Functional\TaxonomyTestBase::setUp()
Same name and namespace in other branches
  1. 11.x core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyTestBase::setUp()
  2. 11.x core/modules/taxonomy/tests/src/Functional/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Functional\TaxonomyTestBase::setUp()
  3. 11.x core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTestBase::setUp()
  4. 10 core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyTestBase::setUp()
  5. 10 core/modules/taxonomy/tests/src/Functional/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Functional\TaxonomyTestBase::setUp()
  6. 10 core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTestBase::setUp()
  7. 9 core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyTestBase::setUp()
  8. 9 core/modules/taxonomy/tests/src/Functional/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Functional\TaxonomyTestBase::setUp()
  9. 9 core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTestBase::setUp()
  10. main core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyTestBase::setUp()
  11. main core/modules/taxonomy/tests/src/Functional/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Functional\TaxonomyTestBase::setUp()
  12. main core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTestBase.php \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTestBase::setUp()

Overrides ViewTestBase::setUp

5 calls to TaxonomyTestBase::setUp()
TaxonomyRelationshipTest::setUp in core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php
TaxonomyTermArgumentDepthTest::setUp in core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php
TaxonomyTermFilterDepthTest::setUp in core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermFilterDepthTest.php
TaxonomyTermViewTest::setUp in core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
TaxonomyVocabularyArgumentTest::setUp in core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php
5 methods override TaxonomyTestBase::setUp()
TaxonomyRelationshipTest::setUp in core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php
TaxonomyTermArgumentDepthTest::setUp in core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php
TaxonomyTermFilterDepthTest::setUp in core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermFilterDepthTest.php
TaxonomyTermViewTest::setUp in core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
TaxonomyVocabularyArgumentTest::setUp in core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php

File

core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTestBase.php, line 58

Class

TaxonomyTestBase
Base class for all taxonomy tests.

Namespace

Drupal\Tests\taxonomy\Functional\Views

Code

protected function setUp($import_test_views = TRUE) {
  parent::setUp($import_test_views);
  $this->mockStandardInstall();
  if ($import_test_views) {
    ViewTestData::createTestViews(get_class($this), [
      'taxonomy_test_views',
    ]);
  }
  $this->term1 = $this->createTerm();
  $this->term2 = $this->createTerm();
  $node = [];
  $node['type'] = 'article';
  $node['field_views_testing_tags'][]['target_id'] = $this->term1
    ->id();
  $node['field_views_testing_tags'][]['target_id'] = $this->term2
    ->id();
  $this->nodes[] = $this->drupalCreateNode($node);
  $this->nodes[] = $this->drupalCreateNode($node);
}

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