function VocabularyTest::testTaxonomyAdminNoVocabularies

Test the vocabulary overview with no vocabularies.

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php, line 112
Definition of Drupal\taxonomy\Tests\VocabularyTest.

Class

VocabularyTest
Tests the taxonomy vocabulary interface.

Namespace

Drupal\taxonomy\Tests

Code

function testTaxonomyAdminNoVocabularies() {

  // Delete all vocabularies.
  $vocabularies = taxonomy_vocabulary_load_multiple();
  foreach ($vocabularies as $key => $vocabulary) {
    $vocabulary
      ->delete();
  }

  // Confirm that no vocabularies are found in the database.
  $this
    ->assertFalse(taxonomy_vocabulary_load_multiple(), 'No vocabularies found.');
  $this
    ->drupalGet('admin/structure/taxonomy');

  // Check the default message for no vocabularies.
  $this
    ->assertText(t('No vocabularies available.'));
}