Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / taxonomy / tests / src / Functional / TermContextualLinksTest.php
diff --git a/web/core/modules/taxonomy/tests/src/Functional/TermContextualLinksTest.php b/web/core/modules/taxonomy/tests/src/Functional/TermContextualLinksTest.php
new file mode 100644 (file)
index 0000000..997e698
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+
+namespace Drupal\Tests\taxonomy\Functional;
+
+/**
+ * Tests views contextual links on terms.
+ *
+ * @group taxonomy
+ */
+class TermContextualLinksTest extends TaxonomyTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = [
+    'contextual',
+  ];
+
+  /**
+   * Tests contextual links.
+   */
+  public function testTermContextualLinks() {
+    $vocabulary = $this->createVocabulary();
+    $term = $this->createTerm($vocabulary);
+
+    $user = $this->drupalCreateUser([
+      'administer taxonomy',
+      'access contextual links',
+    ]);
+    $this->drupalLogin($user);
+
+    $this->drupalGet('taxonomy/term/' . $term->id());
+    $this->assertSession()->elementAttributeContains('css', 'div[data-contextual-id]', 'data-contextual-id', 'taxonomy_term:taxonomy_term=' . $term->id() . ':');
+  }
+
+}