public function EntityEventTest::testEntityDeleteEvent in Hook Event Dispatcher 8
Test EntityDeleteEvent.
File
- tests/
src/ Unit/ Entity/ EntityEventTest.php, line 54
Class
- EntityEventTest
- Class EntityEventTest.
Namespace
Drupal\Tests\hook_event_dispatcher\Unit\EntityCode
public function testEntityDeleteEvent() {
$entity = $this
->createMock(EntityInterface::class);
hook_event_dispatcher_entity_delete($entity);
/** @var \Drupal\hook_event_dispatcher\Event\Entity\EntityDeleteEvent $event */
$event = $this->manager
->getRegisteredEvent(HookEventDispatcherInterface::ENTITY_DELETE);
self::assertEquals($entity, $event
->getEntity());
}