Creates taxonomy vocabulary with custom fields.
To create and attach fields it internally calls TMGMTEntityTestCaseUtility::attachFields(). You can than access these fields calling $this->field_names['node']['YOUR_BUNDLE_NAME'].
string $vid: Vocabulary id.
string $human_name: Vocabulary human readable name.
bool|array $fields_translatable: Flag or definition array to determine which or all fields should be translatable.
stdClass Created vocabulary object.
function createTaxonomyVocab($machine_name, $human_name, $fields_translatable = TRUE) {
$vocabulary = Vocabulary::create([
'name' => $human_name,
'vid' => $machine_name,
]);
$vocabulary
->save();
$this
->attachFields('taxonomy_term', $vocabulary
->id(), $fields_translatable);
return $vocabulary;
}