You are here

public function EntityRevisionTest::testSave in Drupal 10

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

Tests entity revision save.

@covers ::save

File

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

Class

EntityRevisionTest
Tests entity revision destination.

Namespace

Drupal\Tests\migrate\Unit\destination

Code

public function testSave() {
  $entity = $this
    ->prophesize('\\Drupal\\Core\\Entity\\ContentEntityInterface');
  $entity
    ->save()
    ->shouldBeCalled();
  $entity
    ->getRevisionId()
    ->shouldBeCalled()
    ->willReturn(1234);
  $destination = $this
    ->getEntityRevisionDestination();
  $this
    ->assertEquals([
    1234,
  ], $destination
    ->save($entity
    ->reveal(), []));
}