TermContextualLinksTest.php

Same filename and directory in other branches
  1. 9 core/modules/taxonomy/tests/src/Functional/TermContextualLinksTest.php
  2. 8.9.x core/modules/taxonomy/tests/src/Functional/TermContextualLinksTest.php
  3. 10 core/modules/taxonomy/tests/src/Functional/TermContextualLinksTest.php

Namespace

Drupal\Tests\taxonomy\Functional

File

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

View source
<?php

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


/**
 * Tests views contextual links on terms.
 *
 * @group taxonomy
 */
class TermContextualLinksTest extends TaxonomyTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'contextual',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';
  
  /**
   * Tests contextual links.
   */
  public function testTermContextualLinks() : void {
    $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() . ':"]');
  }

}

Classes

Title Deprecated Summary
TermContextualLinksTest Tests views contextual links on terms.

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