function it_emits_money_transfer_requested(EventDispatcherInterface $dispatcher) { $dispatcher->dispatch(MoneyTransferRequestedEnvelope::getEventName(), Argument::type(MoneyTransferRequestedEnvelope::class))->shouldBeCalled(); $events = new EventCollection([new MoneyTransferRequestedEvent(AccountNumber::fromString('123ABC'), new Transfer(Transaction::fromString('000'), AccountNumber::fromString('456DEF'), 100))]); $this->beConstructedWith($dispatcher); $this->emit($events); }
public static function getSubscribedEvents() { return [MoneyWereWithdrawnEnvelope::getEventName() => 'onWithdrawnFromSource', MoneyWereDepositedEnvelope::getEventName() => 'onDepositedOnTarget', MoneyTransferRequestedEnvelope::getEventName() => 'onTransferRequested']; }