You are here

protected function MonitoringCoreWebTest::createVocabulary in Monitoring 8

Returns a new vocabulary with random properties.

Return value

\Drupal\taxonomy\VocabularyInterface; Vocabulary object.

1 call to MonitoringCoreWebTest::createVocabulary()
MonitoringCoreWebTest::testEntityAggregator in tests/src/Functional/MonitoringCoreWebTest.php
Tests the entity aggregator.

File

tests/src/Functional/MonitoringCoreWebTest.php, line 900

Class

MonitoringCoreWebTest
Integration tests for the core pieces of monitoring.

Namespace

Drupal\Tests\monitoring\Functional

Code

protected function createVocabulary() {

  // Create a vocabulary.
  $vocabulary = Vocabulary::create(array(
    'vid' => mb_strtolower($this
      ->randomMachineName()),
    'name' => $this
      ->randomMachineName(),
    'description' => $this
      ->randomMachineName(),
  ));
  $vocabulary
    ->save();
  return $vocabulary;
}