protected function EntityEmbedDetectorTest::setUp in Lingotek Translation 3.8.x
Same name and namespace in other branches
- 4.0.x tests/src/Unit/Plugin/RelatedEntitiesDetector/EntityEmbedDetectorTest.php \Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetector\EntityEmbedDetectorTest::setUp()
- 3.5.x tests/src/Unit/Plugin/RelatedEntitiesDetector/EntityEmbedDetectorTest.php \Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetector\EntityEmbedDetectorTest::setUp()
- 3.6.x tests/src/Unit/Plugin/RelatedEntitiesDetector/EntityEmbedDetectorTest.php \Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetector\EntityEmbedDetectorTest::setUp()
- 3.7.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\RelatedEntitiesDetectorCode
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');
}