public function HookEventDispatcherManagerSpy::getRegisteredEvent in Hook Event Dispatcher 8
Same name and namespace in other branches
- 8.2 tests/src/Unit/HookEventDispatcherManagerSpy.php \Drupal\Tests\hook_event_dispatcher\Unit\HookEventDispatcherManagerSpy::getRegisteredEvent()
- 3.x tests/src/Unit/HookEventDispatcherManagerSpy.php \Drupal\Tests\hook_event_dispatcher\Unit\HookEventDispatcherManagerSpy::getRegisteredEvent()
Getter.
Parameters
string $eventName: Event name.
Return value
\Drupal\hook_event_dispatcher\Event\EventInterface Registered event by name.
File
- tests/
src/ Unit/ HookEventDispatcherManagerSpy.php, line 90
Class
- HookEventDispatcherManagerSpy
- Class HookEventDispatcherManagerSpy.
Namespace
Drupal\Tests\hook_event_dispatcher\UnitCode
public function getRegisteredEvent($eventName) {
if (!isset($this->registeredEvents[$eventName])) {
throw new InvalidArgumentException("The event '{$eventName}' was not registered");
}
return $this->registeredEvents[$eventName];
}