function EntityRevisionTest::setUp

Overrides UnitTestCase::setUp

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

protected function setUp() : void {
  parent::setUp();
  // Setup mocks to be used when creating a revision destination.
  $this->migration = $this->prophesize(MigrationInterface::class)
    ->reveal();
  $this->storage = $this->prophesize(RevisionableStorageInterface::class);
  $entity_type = $this->prophesize(EntityTypeInterface::class);
  $entity_type->getSingularLabel()
    ->willReturn('crazy');
  $entity_type->getPluralLabel()
    ->willReturn('craziness');
  $entity_type->getKey('id')
    ->willReturn('nid');
  $entity_type->getKey('revision')
    ->willReturn('vid');
  $this->storage
    ->getEntityType()
    ->willReturn($entity_type->reveal());
  $this->entityFieldManager = $this->prophesize(EntityFieldManagerInterface::class)
    ->reveal();
  $this->fieldTypeManager = $this->prophesize(FieldTypePluginManagerInterface::class)
    ->reveal();
  $this->accountSwitcher = $this->prophesize(AccountSwitcherInterface::class)
    ->reveal();
  $this->entityTypeBundle = $this->prophesize(EntityTypeBundleInfoInterface::class)
    ->reveal();
}

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