function EntityRevisionTest::testGetEntityDestinationValues

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php \Drupal\Tests\migrate\Unit\destination\EntityRevisionTest::testGetEntityDestinationValues()
  2. 8.9.x core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php \Drupal\Tests\migrate\Unit\destination\EntityRevisionTest::testGetEntityDestinationValues()
  3. 11.x 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 77

Class

EntityRevisionTest
Tests entity revision destination.

Namespace

Drupal\Tests\migrate\Unit\destination

Code

public function testGetEntityDestinationValues() : void {
    $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,
    ]));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.