3 namespace Drupal\Tests\views\Functional;
5 use Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait;
8 * Tests glossary functionality of taxonomy views.
12 class TaxonomyGlossaryTest extends ViewTestBase {
14 use TaxonomyTestTrait;
21 public static $modules = ['taxonomy'];
24 * Views used by this test.
28 public static $testViews = ['test_taxonomy_glossary'];
31 * Taxonomy terms used by this test.
33 * @var \Drupal\taxonomy\Entity\Term[]
35 protected $taxonomyTerms;
37 protected function setUp($import_test_views = TRUE) {
38 parent::setUp($import_test_views);
40 $this->enableViewsTestModule();
42 /** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary */
43 $vocabulary = $this->createVocabulary();
44 for ($i = 0; $i < 10; $i++) {
45 $this->taxonomyTerms[] = $this->createTerm($vocabulary);
50 * Tests a taxonomy glossary view.
52 public function testTaxonomyGlossaryView() {
53 // Go the taxonomy glossary page for the first term.
54 $this->drupalGet('test_taxonomy_glossary/' . substr($this->taxonomyTerms[0]->getName(), 0, 1));
55 $this->assertText($this->taxonomyTerms[0]->getName());