protected function MediaMigrationAssertionsBaseTrait::getImportantEntityProperties in Media Migration 8
Filters out unconcerned properties from an entity.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: An entity instance.
Return value
array The important entity property values as array.
45 calls to MediaMigrationAssertionsBaseTrait::getImportantEntityProperties()
- DrushWithMigrateUpgradeFromFileTest::assertAudioMediaMigrations in tests/
src/ Functional/ DrushWithMigrateUpgradeFromFileTest.php - Tests audio file to media migrations.
- DrushWithMigrateUpgradeFromFileTest::assertD7FieldMigration in tests/
src/ Functional/ DrushWithMigrateUpgradeFromFileTest.php - Tests the Drupal 7 field storage migration.
- DrushWithMigrateUpgradeFromFileTest::assertDocumentMediaMigrations in tests/
src/ Functional/ DrushWithMigrateUpgradeFromFileTest.php - Tests "document" file to media migrations.
- DrushWithMigrateUpgradeFromFileTest::assertImageMediaMigrations in tests/
src/ Functional/ DrushWithMigrateUpgradeFromFileTest.php - Tests image file to media migrations.
- DrushWithMigrateUpgradeFromFileTest::assertVideoMediaMigrations in tests/
src/ Functional/ DrushWithMigrateUpgradeFromFileTest.php - Tests video file to media migrations (of locally stored videos).
File
- tests/
src/ Traits/ MediaMigrationAssertionsBaseTrait.php, line 787
Class
- MediaMigrationAssertionsBaseTrait
- Trait for media migration tests.
Namespace
Drupal\Tests\media_migration\TraitsCode
protected function getImportantEntityProperties(EntityInterface $entity) {
$entity_type_id = $entity
->getEntityTypeId();
$property_filter_preset_property = "{$entity_type_id}UnconcernedProperties";
$entity_array = $entity
->toArray();
$unconcerned_properties = property_exists(get_class($this), $property_filter_preset_property) ? $this->{$property_filter_preset_property} : [
'uuid',
'langcode',
'dependencies',
'_core',
];
foreach ($unconcerned_properties as $item) {
unset($entity_array[$item]);
}
return $entity_array;
}