You are here

public function EntityEventTest::testEntityTranslationInsertEvent in Hook Event Dispatcher 8

Test EntityTranslationInsertEvent.

File

tests/src/Unit/Entity/EntityEventTest.php, line 99

Class

EntityEventTest
Class EntityEventTest.

Namespace

Drupal\Tests\hook_event_dispatcher\Unit\Entity

Code

public function testEntityTranslationInsertEvent() {
  $entity = $this
    ->createMock(EntityInterface::class);
  hook_event_dispatcher_entity_translation_insert($entity);

  /** @var \Drupal\hook_event_dispatcher\Event\Entity\EntityTranslationInsertEvent $event */
  $event = $this->manager
    ->getRegisteredEvent(HookEventDispatcherInterface::ENTITY_TRANSLATION_INSERT);
  self::assertEquals($entity, $event
    ->getEntity());
}