Basic testing, not full coverage.

This commit is contained in:
James Cole
2014-08-19 13:24:11 +02:00
parent f5330728d4
commit f00dfd2859
17 changed files with 325 additions and 162 deletions

View File

@@ -13,12 +13,13 @@ use Illuminate\Events\Dispatcher;
class EloquentPiggybankTrigger
{
/**
* @param \Piggybank $piggyBank
* @param \Piggybank $piggyBank
* @param \TransactionJournal $journal
*/
public function createRelatedTransfer(
\Piggybank $piggyBank, \TransactionJournal $journal, \Transaction $transaction
) {
)
{
$repetition = $piggyBank->repetitionForDate($journal->date);
if (!is_null($repetition)) {
// get the amount transferred TO this
@@ -226,15 +227,17 @@ class EloquentPiggybankTrigger
}
}
public function updateRelatedTransfer(\Piggybank $piggyBank, \TransactionJournal $journal)
public function updateRelatedTransfer(\Piggybank $piggyBank)
{
die('no impl updateRelatedTransfer');
// fire the "update" trigger which should handle things just fine:
\Event::fire('piggybanks.update', [$piggyBank]);
}
//
// /**
// *