class TaxonomyGlossaryTest
Same name and namespace in other branches
- 11.x core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php \Drupal\Tests\views\Functional\TaxonomyGlossaryTest
- 10 core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php \Drupal\Tests\views\Functional\TaxonomyGlossaryTest
- 9 core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php \Drupal\Tests\views\Functional\TaxonomyGlossaryTest
Tests glossary functionality of taxonomy views.
@group views
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\PhpunitCompatibilityTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\views\Functional\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait extends \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\views\Functional\TaxonomyGlossaryTest uses \Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait extends \Drupal\Tests\views\Functional\ViewTestBase
- class \Drupal\Tests\views\Functional\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of TaxonomyGlossaryTest
File
-
core/
modules/ views/ tests/ src/ Functional/ TaxonomyGlossaryTest.php, line 12
Namespace
Drupal\Tests\views\FunctionalView source
class TaxonomyGlossaryTest extends ViewTestBase {
use TaxonomyTestTrait;
/**
* Modules to enable.
*
* @var array
*/
public static $modules = [
'taxonomy',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Views used by this test.
*
* @var array
*/
public static $testViews = [
'test_taxonomy_glossary',
];
/**
* Taxonomy terms used by this test.
*
* @var \Drupal\taxonomy\Entity\Term[]
*/
protected $taxonomyTerms;
protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
$this->enableViewsTestModule();
/** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary */
$vocabulary = $this->createVocabulary();
for ($i = 0; $i < 10; $i++) {
$this->taxonomyTerms[] = $this->createTerm($vocabulary);
}
}
/**
* Tests a taxonomy glossary view.
*/
public function testTaxonomyGlossaryView() {
// Go the taxonomy glossary page for the first term.
$this->drupalGet('test_taxonomy_glossary/' . substr($this->taxonomyTerms[0]
->getName(), 0, 1));
$this->assertText($this->taxonomyTerms[0]
->getName());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.