protected function FeedsKernelTestBase::installTaxonomyModuleWithVocabulary in Feeds 8.3
Installs the taxonomy module and adds a vocabulary.
Return value
\Drupal\taxonomy\VocabularyInterface The created vocabulary.
4 calls to FeedsKernelTestBase::installTaxonomyModuleWithVocabulary()
- EntityReferenceTest::testUpdatingMissingParentTerms in tests/
src/ Kernel/ Feeds/ Target/ EntityReferenceTest.php - Tests if terms get their parent on a second import.
- FeedsKernelTestBase::setUpTermReferenceField in tests/
src/ Kernel/ FeedsKernelTestBase.php - Installs a taxonomy term reference field.
- TranslationTest::setUp in tests/
src/ Kernel/ Feeds/ Target/ TranslationTest.php - UpdateExistingTest::testUpdateTermsInSameVocabulary in tests/
src/ Kernel/ UpdateExistingTest.php - Tests updating terms by name.
File
- tests/
src/ Kernel/ FeedsKernelTestBase.php, line 55
Class
- FeedsKernelTestBase
- Provides a base class for Feeds kernel tests.
Namespace
Drupal\Tests\feeds\KernelCode
protected function installTaxonomyModuleWithVocabulary() {
// Install taxonomy module and schema.
$this
->installModule('taxonomy');
$this
->installConfig([
'filter',
'taxonomy',
]);
$this
->installEntitySchema('taxonomy_term');
// Create tags vocabulary.
$vocabulary = $this->entityTypeManager
->getStorage('taxonomy_vocabulary')
->create([
'vid' => 'tags',
'name' => 'Tags',
]);
$vocabulary
->save();
return $vocabulary;
}