You are here

class TermCacheTagsTest in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/tests/src/Functional/TermCacheTagsTest.php \Drupal\Tests\taxonomy\Functional\TermCacheTagsTest
  2. 9 core/modules/taxonomy/tests/src/Functional/TermCacheTagsTest.php \Drupal\Tests\taxonomy\Functional\TermCacheTagsTest

Tests the Taxonomy term entity's cache tags.

@group taxonomy

Hierarchy

Expanded class hierarchy of TermCacheTagsTest

File

core/modules/taxonomy/tests/src/Functional/TermCacheTagsTest.php, line 14

Namespace

Drupal\Tests\taxonomy\Functional
View source
class TermCacheTagsTest extends EntityWithUriCacheTagsTestBase {

  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'taxonomy',
  ];

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
   */
  protected function createEntity() {

    // Create a "Camelids" vocabulary.
    $vocabulary = Vocabulary::create([
      'name' => 'Camelids',
      'vid' => 'camelids',
    ]);
    $vocabulary
      ->save();

    // Create a "Llama" taxonomy term.
    $term = Term::create([
      'name' => 'Llama',
      'vid' => $vocabulary
        ->id(),
    ]);
    $term
      ->save();
    return $term;
  }

}

Members