You are here

protected function TaxonomyViewsIntegratorTestBase::createVocabulary in Taxonomy Views Integrator 8

Creates and returns a vocabulary.

Parameters

array $settings: (optional) An array of values to override the following default properties of the term:

  • name: A random string.
  • vid: Vocabulary ID of self::$vocabulary object.

Defaults to an empty array.

Return value

\Drupal\taxonomy\Entity\Term The created taxonomy term.

1 call to TaxonomyViewsIntegratorTestBase::createVocabulary()
TaxonomyViewsIntegratorTestBase::setUp in tests/src/Functional/TaxonomyViewsIntegratorTestBase.php

File

tests/src/Functional/TaxonomyViewsIntegratorTestBase.php, line 239

Class

TaxonomyViewsIntegratorTestBase
TVI PHPUnit Test base.

Namespace

Drupal\Tests\tvi\Functional

Code

protected function createVocabulary(array $settings = []) {
  $settings += [
    'name' => $this
      ->randomMachineName(),
    'vid' => $this
      ->randomMachineName(),
  ];
  $vocabulary = Vocabulary::create($settings);
  $vocabulary
    ->save();
  return $vocabulary;
}