You are here

protected function EntityEmbedDetectorTest::setUp in Lingotek Translation 3.7.x

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

Overrides UnitTestCase::setUp

File

tests/src/Unit/Plugin/RelatedEntitiesDetector/EntityEmbedDetectorTest.php, line 67

Class

EntityEmbedDetectorTest
Unit test for the entity_embed entity detector plugin.

Namespace

Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetector

Code

protected function setUp() : void {
  parent::setUp();
  $this->entityRepository = $this
    ->createMock(EntityRepositoryInterface::class);
  $this->entityFieldManager = $this
    ->createMock(EntityFieldManagerInterface::class);
  $this->lingotekConfiguration = $this
    ->createMock(LingotekConfigurationServiceInterface::class);
  $this->detector = new EntityEmbedDetector([], 'entity_embed_detector', [], $this->entityRepository, $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');
}