Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 public static function getSubscribedEvents()
 {
     return [AccountOpenedEnvelope::getEventName() => 'onAccountOpened', MoneyWereDepositedEnvelope::getEventName() => 'onMoneyWereDeposited', MoneyWereWithdrawnEnvelope::getEventName() => 'onMoneyWereWithdrawn'];
 }
Ejemplo n.º 3
0
 public static function getSubscribedEvents()
 {
     return [MoneyWereWithdrawnEnvelope::getEventName() => 'onWithdrawnFromSource', MoneyWereDepositedEnvelope::getEventName() => 'onDepositedOnTarget', MoneyTransferRequestedEnvelope::getEventName() => 'onTransferRequested'];
 }