function TaxonomyTestBase::setUp

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

Overrides ViewsKernelTestBase::setUp

5 calls to TaxonomyTestBase::setUp()
ArgumentValidatorTermNameTest::setUp in core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermNameTest.php
ArgumentValidatorTermTest::setUp in core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php
TaxonomyIndexTidFilterTest::setUp in core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyIndexTidFilterTest.php
TaxonomyTermArgumentDepthTest::setUp in core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermArgumentDepthTest.php
TaxonomyTermFilterDepthTest::setUp in core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermFilterDepthTest.php
5 methods override TaxonomyTestBase::setUp()
ArgumentValidatorTermNameTest::setUp in core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermNameTest.php
ArgumentValidatorTermTest::setUp in core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php
TaxonomyIndexTidFilterTest::setUp in core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyIndexTidFilterTest.php
TaxonomyTermArgumentDepthTest::setUp in core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermArgumentDepthTest.php
TaxonomyTermFilterDepthTest::setUp in core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermFilterDepthTest.php

File

core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTestBase.php, line 77

Class

TaxonomyTestBase
Base class for views kernel taxonomy tests.

Namespace

Drupal\Tests\taxonomy\Kernel\Views

Code

protected function setUp($import_test_views = TRUE) : void {
    parent::setUp($import_test_views);
    // Install node config to create body field.
    $this->installEntitySchema('node');
    $this->installConfig([
        'node',
        'filter',
        'taxonomy',
    ]);
    $this->installEntitySchema('user');
    $this->installEntitySchema('taxonomy_term');
    $this->mockStandardInstall();
    if ($import_test_views) {
        ViewTestData::createTestViews(static::class, [
            '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.