You are here

function RedirectUITest::createVocabulary in Redirect 8

Returns a new vocabulary with random properties.

1 call to RedirectUITest::createVocabulary()
RedirectUITest::testAutomaticRedirects in tests/src/Functional/RedirectUITest.php
Tests redirects being automatically created upon path alias change.

File

tests/src/Functional/RedirectUITest.php, line 194

Class

RedirectUITest
UI tests for redirect module.

Namespace

Drupal\Tests\redirect\Functional

Code

function createVocabulary() {

  // Create a vocabulary.
  $vocabulary = Vocabulary::create([
    'name' => $this
      ->randomMachineName(),
    'description' => $this
      ->randomMachineName(),
    'vid' => mb_strtolower($this
      ->randomMachineName()),
    'langcode' => Language::LANGCODE_NOT_SPECIFIED,
    'weight' => mt_rand(0, 10),
  ]);
  $vocabulary
    ->save();
  return $vocabulary;
}