protected function MigrateTermLocalizedTranslationTest::assertEntity in Drupal 9
Same name in this branch
- 9 core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermLocalizedTranslationTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateTermLocalizedTranslationTest::assertEntity()
- 9 core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTermLocalizedTranslationTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d7\MigrateTermLocalizedTranslationTest::assertEntity()
Same name and namespace in other branches
- 8 core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermLocalizedTranslationTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateTermLocalizedTranslationTest::assertEntity()
Validates a migrated term contains the expected values.
Parameters
int $id: Entity ID to load and check.
string $expected_language: The language code for this term.
string $expected_label: The label the migrated entity should have.
string $expected_vid: The parent vocabulary the migrated entity should have.
string $expected_description: The description the migrated entity should have.
string $expected_format: The format the migrated entity should have.
int $expected_weight: The weight the migrated entity should have.
array $expected_parents: The parent terms the migrated entity should have.
int $expected_field_integer_value: The value the migrated entity field should have.
int $expected_term_reference_tid: The term reference ID the migrated entity field should have.
1 call to MigrateTermLocalizedTranslationTest::assertEntity()
- MigrateTermLocalizedTranslationTest::testTranslatedLocalizedTaxonomyTerms in core/
modules/ taxonomy/ tests/ src/ Kernel/ Migrate/ d6/ MigrateTermLocalizedTranslationTest.php - Tests the Drupal 6 i18n localized taxonomy term to Drupal 8 migration.
File
- core/
modules/ taxonomy/ tests/ src/ Kernel/ Migrate/ d6/ MigrateTermLocalizedTranslationTest.php, line 76
Class
- MigrateTermLocalizedTranslationTest
- Tests migration of localized translated taxonomy terms.
Namespace
Drupal\Tests\taxonomy\Kernel\Migrate\d6Code
protected function assertEntity($id, $expected_language, $expected_label, $expected_vid, $expected_description = '', $expected_format = NULL, $expected_weight = 0, array $expected_parents = [], $expected_field_integer_value = NULL, $expected_term_reference_tid = NULL) {
/** @var \Drupal\taxonomy\TermInterface $entity */
$entity = Term::load($id);
$this
->assertInstanceOf(TermInterface::class, $entity);
$this
->assertSame($expected_language, $entity
->language()
->getId());
$this
->assertSame($expected_label, $entity
->label());
$this
->assertSame($expected_vid, $entity
->bundle());
$this
->assertSame($expected_description, $entity
->getDescription());
$this
->assertSame($expected_format, $entity
->getFormat());
$this
->assertSame($expected_weight, $entity
->getWeight());
$this
->assertHierarchy($expected_vid, $id, $expected_parents);
}