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