class MigrateTaxonomyVocabularyTest
Same name in this branch
- 9 core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateTaxonomyVocabularyTest
Same name and namespace in other branches
- 11.x core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateTaxonomyVocabularyTest
- 11.x core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d7\MigrateTaxonomyVocabularyTest
- 10 core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTest.php \Drupal\Tests\forum\Kernel\Migrate\d6\MigrateTaxonomyVocabularyTest
- 10 core/modules/forum/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php \Drupal\Tests\forum\Kernel\Migrate\d7\MigrateTaxonomyVocabularyTest
- 10 core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateTaxonomyVocabularyTest
- 10 core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d7\MigrateTaxonomyVocabularyTest
- 8.9.x core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateTaxonomyVocabularyTest
- 8.9.x core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d7\MigrateTaxonomyVocabularyTest
Migrate taxonomy vocabularies to taxonomy.vocabulary.*.yml.
@group taxonomy
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase implements \Drupal\migrate\MigrateMessageInterface extends \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase extends \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait extends \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\taxonomy\Kernel\Migrate\d7\MigrateTaxonomyVocabularyTest extends \Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait extends \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase extends \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase implements \Drupal\migrate\MigrateMessageInterface extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of MigrateTaxonomyVocabularyTest
File
-
core/
modules/ taxonomy/ tests/ src/ Kernel/ Migrate/ d7/ MigrateTaxonomyVocabularyTest.php, line 14
Namespace
Drupal\Tests\taxonomy\Kernel\Migrate\d7View source
class MigrateTaxonomyVocabularyTest extends MigrateDrupal7TestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'taxonomy',
'text',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->executeMigration('d7_taxonomy_vocabulary');
}
/**
* Validate a migrated vocabulary contains the expected values.
*
* @param string $id
* Entity ID to load and check.
* @param $expected_label
* The label the migrated entity should have.
* @param $expected_description
* The description the migrated entity should have.
* @param $expected_weight
* The weight the migrated entity should have.
*
* @internal
*/
protected function assertEntity(string $id, string $expected_label, string $expected_description, int $expected_weight) : void {
/** @var \Drupal\taxonomy\VocabularyInterface $entity */
$entity = Vocabulary::load($id);
$this->assertInstanceOf(VocabularyInterface::class, $entity);
$this->assertSame($expected_label, $entity->label());
$this->assertSame($expected_description, $entity->getDescription());
$this->assertSame($expected_weight, (int) $entity->get('weight'));
}
/**
* Tests the Drupal 7 taxonomy vocabularies to Drupal 8 migration.
*/
public function testTaxonomyVocabulary() {
$this->assertEntity('tags', 'Tags', 'Use tags to group articles on similar topics into categories.', 0);
$this->assertEntity('forums', 'Sujet de discussion', 'Forum navigation vocabulary', -10);
$this->assertEntity('test_vocabulary', 'Test Vocabulary', 'This is the vocabulary description', 0);
$this->assertEntity('vocabulary_name_much_longer_th', 'vocabulary name clearly different than machine name and much longer than thirty two characters', 'description of vocabulary name much longer than thirty two characters', 0);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.