Do you also mean create an assertion like assertEventHasBeenRaised('\FQCN', EventProviderInterface $eventProvider)?
something like
/**
* Assert that the event class name was raised.
*
* @param string $eventClassName The string classname
* @param \LiteCQRS\EventProviderInterface $eventProvider The Event Provider
*/
public function assertEventHasBeenRaised($eventClassName, \LiteCQRS\EventProviderInterface $eventProvider)
{
$eventClassName = trim($eventClassName, "\\");
$count = count(array_filter($eventProvider->getAppliedEvents(), function($k) use($eventClassName) {
return ($eventClassName == trim(get_class($k), "\\"));
}));
$this->assertGreaterThan(0, $count, sprintf('The event \'%s\' was not raised but the eventProvider.', $eventClassName));
}
Do you also mean create an assertion like
assertEventHasBeenRaised('\FQCN', EventProviderInterface $eventProvider)
?something like