You are here

public function PathautoTestHelperTrait::addVocabulary in Pathauto 8

Parameters

array $values:

Return value

\Drupal\taxonomy\VocabularyInterface

5 calls to PathautoTestHelperTrait::addVocabulary()
PathautoKernelTest::testPathTokens in tests/src/Kernel/PathautoKernelTest.php
Test the handling of path vs non-path tokens in pathauto_clean_token_values().
PathautoKernelTest::testProgrammaticEntityCreation in tests/src/Kernel/PathautoKernelTest.php
Test programmatic entity creation for aliases.
PathautoKernelTest::testTaxonomyPattern in tests/src/Kernel/PathautoKernelTest.php
Tests aliases on taxonomy terms.
PathautoMassDeleteTest::generateAliases in tests/src/Functional/PathautoMassDeleteTest.php
Helper function to generate aliases.
PathautoTaxonomyWebTest::testTermEditing in tests/src/Functional/PathautoTaxonomyWebTest.php
Basic functional testing of Pathauto with taxonomy terms.

File

tests/src/Functional/PathautoTestHelperTrait.php, line 149

Class

PathautoTestHelperTrait
Helper test class with some added functions for testing.

Namespace

Drupal\Tests\pathauto\Functional

Code

public function addVocabulary(array $values = []) {
  $name = mb_strtolower($this
    ->randomMachineName(5));
  $values += [
    'name' => $name,
    'vid' => $name,
  ];
  $vocabulary = Vocabulary::create($values);
  $vocabulary
    ->save();
  return $vocabulary;
}