function it_appends_deposit_entry_when_money_were_withdrawn()
 {
     $accountNumber = AccountNumber::fromString('123ABC');
     $openAccount = new AccountOpenedEvent($accountNumber);
     $this->onAccountOpened(AccountOpenedEnvelope::wrap($openAccount));
     $withdraw = new MoneyWereWithdrawnEvent($accountNumber, new Withdraw(Transaction::generate(), 100));
     $this->onMoneyWereWithdrawn(MoneyWereWithdrawnEnvelope::wrap($withdraw));
     $this->getAccount('123ABC')->getHistory()[1]->getAmount()->shouldReturn(100);
 }
 function it_decreases_balance_when_money_were_withdrawn()
 {
     $accountNumber = AccountNumber::fromString('123ABC');
     $openAccount = new AccountOpenedEvent($accountNumber);
     $event = AccountOpenedEnvelope::wrap($openAccount);
     $this->onAccountOpened($event);
     $withdraw = new MoneyWereWithdrawnEvent($accountNumber, new Withdraw(Transaction::generate(), 100));
     $event = MoneyWereWithdrawnEnvelope::wrap($withdraw);
     $this->onMoneyWereWithdrawn($event);
     $this->getAccount('123ABC')->getBalance()->shouldReturn(-100);
 }