You are here

function VocabularyUiTest::testTaxonomyAdminNoVocabularies in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/src/Tests/VocabularyUiTest.php \Drupal\taxonomy\Tests\VocabularyUiTest::testTaxonomyAdminNoVocabularies()

Test the vocabulary overview with no vocabularies.

File

core/modules/taxonomy/src/Tests/VocabularyUiTest.php, line 118
Contains \Drupal\taxonomy\Tests\VocabularyUiTest.

Class

VocabularyUiTest
Tests the taxonomy vocabulary interface.

Namespace

Drupal\taxonomy\Tests

Code

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
    ->assertFalse(Vocabulary::loadMultiple(), 'No vocabularies found.');
  $this
    ->drupalGet('admin/structure/taxonomy');

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