You are here

protected function MakeUniqueEntityFieldTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php \Drupal\Tests\migrate\Unit\process\MakeUniqueEntityFieldTest::setUp()

Overrides MigrateProcessTestCase::setUp

File

core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php, line 42

Class

MakeUniqueEntityFieldTest
@coversDefaultClass \Drupal\migrate\Plugin\migrate\process\MakeUniqueEntityField @group migrate

Namespace

Drupal\Tests\migrate\Unit\process

Code

protected function setUp() : void {
  $this->entityQuery = $this
    ->getMockBuilder('Drupal\\Core\\Entity\\Query\\QueryInterface')
    ->disableOriginalConstructor()
    ->getMock();
  $this->entityQuery
    ->expects($this
    ->any())
    ->method('accessCheck')
    ->will($this
    ->returnSelf());
  $this->entityTypeManager = $this
    ->createMock(EntityTypeManagerInterface::class);
  $storage = $this
    ->createMock(EntityStorageInterface::class);
  $storage
    ->expects($this
    ->any())
    ->method('getQuery')
    ->willReturn($this->entityQuery);
  $this->entityTypeManager
    ->expects($this
    ->any())
    ->method('getStorage')
    ->with('test_entity_type')
    ->willReturn($storage);
  parent::setUp();
}