function it_emits_money_were_withdrawn_event(EventDispatcherInterface $dispatcher) { $dispatcher->dispatch(MoneyWereWithdrawnEnvelope::getEventName(), Argument::type(MoneyWereWithdrawnEnvelope::class))->shouldBeCalled(); $events = new EventCollection([new MoneyWereWithdrawnEvent(AccountNumber::fromString('123ABC'), new Withdraw(Transaction::fromString('000'), 100))]); $this->beConstructedWith($dispatcher); $this->emit($events); }
public static function getSubscribedEvents() { return [AccountOpenedEnvelope::getEventName() => 'onAccountOpened', MoneyWereDepositedEnvelope::getEventName() => 'onMoneyWereDeposited', MoneyWereWithdrawnEnvelope::getEventName() => 'onMoneyWereWithdrawn']; }
public static function getSubscribedEvents() { return [MoneyWereWithdrawnEnvelope::getEventName() => 'onWithdrawnFromSource', MoneyWereDepositedEnvelope::getEventName() => 'onDepositedOnTarget', MoneyTransferRequestedEnvelope::getEventName() => 'onTransferRequested']; }