You are here

class TermContextualLinksTest in Drupal 10

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

Tests views contextual links on terms.

@group taxonomy

Hierarchy

Expanded class hierarchy of TermContextualLinksTest

File

core/modules/taxonomy/tests/src/Functional/TermContextualLinksTest.php, line 10

Namespace

Drupal\Tests\taxonomy\Functional
View source
class TermContextualLinksTest extends TaxonomyTestBase {

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

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

  /**
   * 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()
      ->elementExists('css', 'div[data-contextual-id^="taxonomy_term:taxonomy_term=' . $term
      ->id() . ':"]');
  }

}

Members