You are here

protected function FieldLinkDetectorTest::setUp in Lingotek Translation 3.5.x

Same name and namespace in other branches
  1. 4.0.x tests/src/Unit/Plugin/RelatedEntitiesDetector/FieldLinkDetectorTest.php \Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetector\FieldLinkDetectorTest::setUp()
  2. 3.6.x tests/src/Unit/Plugin/RelatedEntitiesDetector/FieldLinkDetectorTest.php \Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetector\FieldLinkDetectorTest::setUp()
  3. 3.7.x tests/src/Unit/Plugin/RelatedEntitiesDetector/FieldLinkDetectorTest.php \Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetector\FieldLinkDetectorTest::setUp()
  4. 3.8.x tests/src/Unit/Plugin/RelatedEntitiesDetector/FieldLinkDetectorTest.php \Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetector\FieldLinkDetectorTest::setUp()

Overrides UnitTestCase::setUp

File

tests/src/Unit/Plugin/RelatedEntitiesDetector/FieldLinkDetectorTest.php, line 66

Class

FieldLinkDetectorTest
Unit test for the html links entity detector plugin.

Namespace

Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetector

Code

protected function setUp() : void {
  parent::setUp();
  $this->entityTypeManager = $this
    ->createMock(EntityTypeManagerInterface::class);
  $this->entityFieldManager = $this
    ->createMock(EntityFieldManagerInterface::class);
  $this->lingotekConfiguration = $this
    ->createMock(LingotekConfigurationServiceInterface::class);
  $this->detector = new FieldLinkDetector([], 'field_link_detector', [], $this->entityTypeManager, $this->entityFieldManager, $this->lingotekConfiguration);
  $this->entityType = $this
    ->createMock(ContentEntityTypeInterface::class);
  $this->entityType
    ->expects($this
    ->any())
    ->method('hasKey')
    ->with('langcode')
    ->willReturn(TRUE);
  $this->entityType
    ->expects($this
    ->any())
    ->method('id')
    ->willReturn('bundle_id');
  $this->entityType
    ->expects($this
    ->any())
    ->method('getBundleEntityType')
    ->willReturn('entity_id');
  $this->entityType
    ->expects($this
    ->any())
    ->method('getLabel')
    ->willReturn('Entity');
}