diff --git a/src/Plugin/migrate/destination/EntityReferenceRevisions.php b/src/Plugin/migrate/destination/EntityReferenceRevisions.php index 5dd9ddd..497e1ea 100644 --- a/src/Plugin/migrate/destination/EntityReferenceRevisions.php +++ b/src/Plugin/migrate/destination/EntityReferenceRevisions.php @@ -3,6 +3,7 @@ namespace Drupal\entity_reference_revisions\Plugin\migrate\destination; use Drupal\Core\Entity\ContentEntityInterface; +use Drupal\Core\TypedData\TranslatableInterface; use Drupal\migrate\MigrateException; use Drupal\migrate\Plugin\migrate\destination\EntityRevision; use Drupal\migrate\Row; diff --git a/tests/src/Kernel/Plugin/migrate/destination/EntityReferenceRevisionsDestinationTest.php b/tests/src/Kernel/Plugin/migrate/destination/EntityReferenceRevisionsDestinationTest.php index 480ab48..85cd928 100644 --- a/tests/src/Kernel/Plugin/migrate/destination/EntityReferenceRevisionsDestinationTest.php +++ b/tests/src/Kernel/Plugin/migrate/destination/EntityReferenceRevisionsDestinationTest.php @@ -69,7 +69,6 @@ public function testGetEntityTypeId() { * @covers ::getEntity * @covers ::rollback * @covers ::rollbackNonTranslation - * @covers ::loadEntityReferenceRevision */ public function testGetEntity() { /** @var MigrationPluginManager $migrationManager */ @@ -78,18 +77,20 @@ public function testGetEntity() { /** @var Migration $migration */ $migration = $migrationManager->createStubMigration($definition); $migrationExecutable = (new MigrateExecutable($migration, $this)); + /** @var EntityStorageBase $storage */ + $storage = $this->readAttribute($migration->getDestinationPlugin(), 'storage'); for ($i = 0; $i < 2; $i++) { $migrationExecutable->import(); $migration->getIdMap()->prepareUpdate(); - $entity = $migration->getDestinationPlugin()->loadEntityReferenceRevision(1, 1); + $entity = $storage->loadRevision(1); $this->assertEquals('content item 1', $entity->label()); - $entity = $migration->getDestinationPlugin()->loadEntityReferenceRevision(2, 2); + $entity = $storage->loadRevision(2); $this->assertEquals('content item 2', $entity->label()); } $migrationExecutable->rollback(); - $entity = $migration->getDestinationPlugin()->loadEntityReferenceRevision(1, 1); + $entity = $storage->loadRevision(1); $this->assertEmpty($entity); - $entity = $migration->getDestinationPlugin()->loadEntityReferenceRevision(2, 2); + $entity = $storage->loadRevision(2); $this->assertEmpty($entity); }