You are here

public function EntityRevisionTest::testGetEntityDestinationValues in Zircon Profile 8

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

Test that passed old destination values are used by default.

@covers ::getEntity

File

core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php, line 59
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\\EntityInterface')
    ->willImplement('\\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,
  ]));
}