public function EntityEventTest::testEntityUpdateEvent 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::testEntityUpdateEvent()
Test EntityUpdateEvent.
File
- modules/
core_event_dispatcher/ tests/ src/ Unit/ Entity/ EntityEventTest.php, line 176
Class
- EntityEventTest
- Class EntityEventTest.
Namespace
Drupal\Tests\core_event_dispatcher\Unit\EntityCode
public function testEntityUpdateEvent() : void {
$entity = $this
->createMock(EntityInterface::class);
$originalEntity = $this
->createMock(EntityInterface::class);
$entity->original = $originalEntity;
core_event_dispatcher_entity_update($entity);
/** @var \Drupal\core_event_dispatcher\Event\Entity\EntityUpdateEvent $event */
$event = $this->manager
->getRegisteredEvent(HookEventDispatcherInterface::ENTITY_UPDATE);
self::assertSame($entity, $event
->getEntity());
self::assertSame($originalEntity, $event
->getOriginalEntity());
}