You are here

public function EntityEventTest::testEntityPredeleteEvent in Hook Event Dispatcher 8

Test EntityPredeleteEvent.

File

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

Class

EntityEventTest
Class EntityEventTest.

Namespace

Drupal\Tests\hook_event_dispatcher\Unit\Entity

Code

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

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