You are here

protected function EntityRevisionTest::setUp in Drupal 10

Same name in this branch
  1. 10 core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php \Drupal\Tests\migrate\Unit\destination\EntityRevisionTest::setUp()
  2. 10 core/modules/migrate/tests/src/Kernel/Plugin/EntityRevisionTest.php \Drupal\Tests\migrate\Kernel\Plugin\EntityRevisionTest::setUp()
  3. 10 core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php \Drupal\Tests\migrate\Unit\Plugin\migrate\destination\EntityRevisionTest::setUp()
Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php \Drupal\Tests\migrate\Unit\destination\EntityRevisionTest::setUp()
  2. 9 core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php \Drupal\Tests\migrate\Unit\destination\EntityRevisionTest::setUp()

Overrides UnitTestCase::setUp

File

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

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);
  $this->storage = $this
    ->prophesize('\\Drupal\\Core\\Entity\\EntityStorageInterface');
  $entity_type = $this
    ->prophesize(EntityTypeInterface::class);
  $entity_type
    ->getSingularLabel()
    ->willReturn('crazy');
  $entity_type
    ->getPluralLabel()
    ->willReturn('craziness');
  $this->storage
    ->getEntityType()
    ->willReturn($entity_type
    ->reveal());
  $this->entityFieldManager = $this
    ->prophesize('\\Drupal\\Core\\Entity\\EntityFieldManagerInterface');
  $this->fieldTypeManager = $this
    ->prophesize('\\Drupal\\Core\\Field\\FieldTypePluginManagerInterface');
  $this->accountSwitcher = $this
    ->prophesize(AccountSwitcherInterface::class);
}