public function EntityRevisionTest::testGetEntityDestinationValues in Drupal 8
Same name and namespace in other branches
- 9 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 67 - Contains \Drupal\Tests\migrate\Unit\destination\EntityRevisionTest.
Class
- EntityRevisionTest
- Tests entity revision destination.
Namespace
Drupal\Tests\migrate\Unit\destinationCode
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,
]));
}