Fixed some tests.

This commit is contained in:
James Cole 2015-05-13 21:37:11 +02:00
parent 199f348ff4
commit 0e068d4ccf

View File

@ -50,6 +50,7 @@ class ConnectJournalToPiggyBankTest extends TestCase
$this->be($user);
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
/** @var \FireflyIII\Models\PiggyBank $piggyBank */
$piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
$account1 = FactoryMuffin::create('FireflyIII\Models\Account');
$account2 = FactoryMuffin::create('FireflyIII\Models\Account');
@ -60,6 +61,13 @@ class ConnectJournalToPiggyBankTest extends TestCase
$account2->save();
$piggyBank->save();
// because the event handler responds to this piggy bank, we must remove
// the piggy bank repetition:
/** @var \FireflyIII\Models\PiggyBankRepetition $rep */
foreach($piggyBank->piggyBankRepetitions()->get() as $rep) {
$rep->forceDelete();
}
Transaction::create(
[
'account_id' => $account1->id,