Mercurial > hg > isophonics-drupal-site
comparison core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\Tests\views\Functional; | |
4 | |
5 use Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait; | |
6 | |
7 /** | |
8 * Tests glossary functionality of taxonomy views. | |
9 * | |
10 * @group views | |
11 */ | |
12 class TaxonomyGlossaryTest extends ViewTestBase { | |
13 | |
14 use TaxonomyTestTrait; | |
15 | |
16 /** | |
17 * Modules to enable. | |
18 * | |
19 * @var array | |
20 */ | |
21 public static $modules = ['taxonomy']; | |
22 | |
23 /** | |
24 * Views used by this test. | |
25 * | |
26 * @var array | |
27 */ | |
28 public static $testViews = ['test_taxonomy_glossary']; | |
29 | |
30 /** | |
31 * Taxonomy terms used by this test. | |
32 * | |
33 * @var \Drupal\taxonomy\Entity\Term[] | |
34 */ | |
35 protected $taxonomyTerms; | |
36 | |
37 protected function setUp($import_test_views = TRUE) { | |
38 parent::setUp($import_test_views); | |
39 | |
40 $this->enableViewsTestModule(); | |
41 | |
42 /** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary */ | |
43 $vocabulary = $this->createVocabulary(); | |
44 for ($i = 0; $i < 10; $i++) { | |
45 $this->taxonomyTerms[] = $this->createTerm($vocabulary); | |
46 } | |
47 } | |
48 | |
49 /** | |
50 * Tests a taxonomy glossary view. | |
51 */ | |
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()); | |
56 } | |
57 | |
58 } |