You are here

public function EntityRevisionTest::testGetEntityDestinationValues in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php \Drupal\Tests\migrate\Unit\destination\EntityRevisionTest::testGetEntityDestinationValues()

Tests that passed old destination values are used by default.

@covers ::getEntity

File

core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php, line 67
Contains \Drupal\Tests\migrate\Unit\destination\EntityRevisionTest.

Class

EntityRevisionTest
Tests entity revision destination.

Namespace

Drupal\Tests\migrate\Unit\destination

Code

public function testGetEntityDestinationValues() {
  $destination = $this
    ->getEntityRevisionDestination([]);

  // Return a dummy because we don't care what gets called.
  $entity = $this
    ->prophesize('\\Drupal\\Core\\Entity\\RevisionableInterface');

  // Assert that the first ID from the destination values is used to load the
  // entity.
  $this->storage
    ->loadRevision(12)
    ->shouldBeCalled()
    ->willReturn($entity
    ->reveal());
  $row = new Row();
  $this
    ->assertEquals($entity
    ->reveal(), $destination
    ->getEntity($row, [
    12,
    13,
  ]));
}