function MakeUniqueEntityFieldTest::setUp

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php \Drupal\Tests\migrate\Unit\process\MakeUniqueEntityFieldTest::setUp()
  2. 8.9.x core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php \Drupal\Tests\migrate\Unit\process\MakeUniqueEntityFieldTest::setUp()
  3. 11.x 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 44

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')
        ->willReturnSelf();
    $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();
}

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