public function EntityEventTest::testEntityLoadEvent in Hook Event Dispatcher 8.2
Same name and namespace in other branches
- 3.x modules/core_event_dispatcher/tests/src/Unit/Entity/EntityEventTest.php \Drupal\Tests\core_event_dispatcher\Unit\Entity\EntityEventTest::testEntityLoadEvent()
Test EntityLoadEvent.
File
- modules/
core_event_dispatcher/ tests/ src/ Unit/ Entity/ EntityEventTest.php, line 88
Class
- EntityEventTest
- Class EntityEventTest.
Namespace
Drupal\Tests\core_event_dispatcher\Unit\EntityCode
public function testEntityLoadEvent() : void {
$entities = [
$this
->createMock(EntityInterface::class),
$this
->createMock(EntityInterface::class),
$this
->createMock(EntityInterface::class),
];
$entityTypeId = 'test';
core_event_dispatcher_entity_load($entities, $entityTypeId);
/** @var \Drupal\core_event_dispatcher\Event\Entity\EntityLoadEvent $event */
$event = $this->manager
->getRegisteredEvent(HookEventDispatcherInterface::ENTITY_LOAD);
self::assertSame($entities, $event
->getEntities());
self::assertSame($entityTypeId, $event
->getEntityTypeId());
}