TaxonomyTestBase.php

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

Namespace

Drupal\Tests\taxonomy\Functional

File

core/modules/taxonomy/tests/src/Functional/TaxonomyTestBase.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\taxonomy\Functional;

use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait;
use Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait;

/**
 * Provides common helper methods for Taxonomy module tests.
 */
abstract class TaxonomyTestBase extends BrowserTestBase {
    use TaxonomyTestTrait;
    use EntityReferenceFieldCreationTrait;
    
    /**
     * {@inheritdoc}
     */
    protected static $modules = [
        'taxonomy',
        'block',
    ];
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() : void {
        parent::setUp();
        $this->drupalPlaceBlock('system_breadcrumb_block');
        // Create Basic page and Article node types.
        if ($this->profile != 'standard') {
            $this->drupalCreateContentType([
                'type' => 'article',
                'name' => 'Article',
            ]);
        }
    }

}

Classes

Title Deprecated Summary
TaxonomyTestBase Provides common helper methods for Taxonomy module tests.

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