-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Setting up Subscriber tests as detailed here works in general. But once a callback expects additional arguments like $recordedOn, or any other custom ArgumentResolver this fails. Passing the array of ArgumentResolvers does not help either - that information is simply not available.
When I change the executeRun method to accept messages instead, and pass the RecordedAtHeader as an header along, everything works as expected.
Figure it might make sense to add an additional function here that does this:
/** @param array<Message> $messages */
public function executeRun(array $messages): self
{
$subscriberAccessors = $this->subscriberAccessorRepository->all();
foreach ($messages as $message) {
$eventClass = $message->event()::class;
foreach ($subscriberAccessors as $subscriberAccessor) {
foreach ($subscriberAccessor->subscribeMethods($eventClass) as $subscribeMethod) {
$subscribeMethod($message);
}
}
}
return $this;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels