public function VocabularyUiTest::testTaxonomyAdminNoVocabularies in Drupal 8
Same name and namespace in other branches
- 9 core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php \Drupal\Tests\taxonomy\Functional\VocabularyUiTest::testTaxonomyAdminNoVocabularies()
- 10 core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php \Drupal\Tests\taxonomy\Functional\VocabularyUiTest::testTaxonomyAdminNoVocabularies()
Test the vocabulary overview with no vocabularies.
File
- core/
modules/ taxonomy/ tests/ src/ Functional/ VocabularyUiTest.php, line 119
Class
- VocabularyUiTest
- Tests the taxonomy vocabulary interface.
Namespace
Drupal\Tests\taxonomy\FunctionalCode
public function testTaxonomyAdminNoVocabularies() {
// Delete all vocabularies.
$vocabularies = Vocabulary::loadMultiple();
foreach ($vocabularies as $key => $vocabulary) {
$vocabulary
->delete();
}
// Confirm that no vocabularies are found in the database.
$this
->assertEmpty(Vocabulary::loadMultiple(), 'No vocabularies found.');
$this
->drupalGet('admin/structure/taxonomy');
// Check the default message for no vocabularies.
$this
->assertText(t('No vocabularies available.'));
}