mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fixed tests.
This commit is contained in:
parent
620848272e
commit
5e57a390a2
@ -110,7 +110,7 @@ class Tag extends Model
|
|||||||
$journal->tag_count = $count;
|
$journal->tag_count = $count;
|
||||||
$journal->save();
|
$journal->save();
|
||||||
}
|
}
|
||||||
parent::save($options);
|
return parent::save($options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -214,6 +214,15 @@ class TransactionJournal extends Model
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
|
*/
|
||||||
|
public function tags()
|
||||||
|
{
|
||||||
|
return $this->belongsToMany('FireflyIII\Models\Tag');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $amount
|
* @param string $amount
|
||||||
*
|
*
|
||||||
@ -279,16 +288,8 @@ class TransactionJournal extends Model
|
|||||||
{
|
{
|
||||||
$count = $this->tags()->count();
|
$count = $this->tags()->count();
|
||||||
$this->tag_count = $count;
|
$this->tag_count = $count;
|
||||||
parent::save($options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return parent::save($options);
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
|
||||||
*/
|
|
||||||
public function tags()
|
|
||||||
{
|
|
||||||
return $this->belongsToMany('FireflyIII\Models\Tag');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -109,6 +109,9 @@ class TransactionJournalModelTest extends TestCase
|
|||||||
$tag->transactionJournals()->save($withdrawal);
|
$tag->transactionJournals()->save($withdrawal);
|
||||||
$tag->transactionJournals()->save($deposit);
|
$tag->transactionJournals()->save($deposit);
|
||||||
|
|
||||||
|
$withdrawal->save();
|
||||||
|
$deposit->save();
|
||||||
|
|
||||||
// amount should be 210.12:
|
// amount should be 210.12:
|
||||||
$this->assertEquals('210.12', $withdrawal->amount);
|
$this->assertEquals('210.12', $withdrawal->amount);
|
||||||
$this->assertEquals('0', $deposit->amount);
|
$this->assertEquals('0', $deposit->amount);
|
||||||
@ -175,8 +178,11 @@ class TransactionJournalModelTest extends TestCase
|
|||||||
$transfer->transactions[1]->amount = 123.45;
|
$transfer->transactions[1]->amount = 123.45;
|
||||||
$transfer->transactions[1]->save();
|
$transfer->transactions[1]->save();
|
||||||
|
|
||||||
|
$withdrawal->save();
|
||||||
$amount = $withdrawal->amount;
|
$amount = $withdrawal->amount;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$this->assertEquals('0', $amount);
|
$this->assertEquals('0', $amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user