Version 1
[yaffs-website] / web / core / modules / taxonomy / tests / src / Functional / TermCacheTagsTest.php
diff --git a/web/core/modules/taxonomy/tests/src/Functional/TermCacheTagsTest.php b/web/core/modules/taxonomy/tests/src/Functional/TermCacheTagsTest.php
new file mode 100644 (file)
index 0000000..35b7d6b
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+namespace Drupal\Tests\taxonomy\Functional;
+
+use Drupal\system\Tests\Entity\EntityWithUriCacheTagsTestBase;
+use Drupal\taxonomy\Entity\Vocabulary;
+use Drupal\taxonomy\Entity\Term;
+
+/**
+ * Tests the Taxonomy term entity's cache tags.
+ *
+ * @group taxonomy
+ */
+class TermCacheTagsTest extends EntityWithUriCacheTagsTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['taxonomy'];
+
+  /**
+   * {@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;
+  }
+
+}