Fix tests and fix coverage.

This commit is contained in:
James Cole
2015-06-06 15:36:12 +02:00
parent 681167bc1b
commit db020db34b
19 changed files with 381 additions and 286 deletions

View File

@@ -38,6 +38,7 @@ class BudgetRepositoryTest extends TestCase
/**
* @covers FireflyIII\Repositories\Budget\BudgetRepository::cleanupBudgets
* @covers FireflyIII\Providers\EventServiceProvider::boot
*/
public function testCleanupBudgets()
{
@@ -155,6 +156,8 @@ class BudgetRepositoryTest extends TestCase
*/
public function testGetCurrentRepetition()
{
$user = FactoryMuffin::create('FireflyIII\User');
$this->be($user);
/** @var Budget $budget */
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
$rep = $this->object->getCurrentRepetition($budget, new Carbon);
@@ -210,6 +213,9 @@ class BudgetRepositoryTest extends TestCase
*/
public function testGetJournals()
{
$user = FactoryMuffin::create('FireflyIII\User');
$this->be($user);
$repetition = FactoryMuffin::create('FireflyIII\Models\LimitRepetition');
$set = $this->object->getJournals($repetition->budgetlimit->budget, $repetition);
@@ -294,6 +300,9 @@ class BudgetRepositoryTest extends TestCase
*/
public function testSpentInPeriodCorrected()
{
$user = FactoryMuffin::create('FireflyIII\User');
$this->be($user);
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
$amount = $this->object->spentInPeriodCorrected($budget, new Carbon, new Carbon, false);
@@ -306,6 +315,9 @@ class BudgetRepositoryTest extends TestCase
*/
public function testSpentInPeriodCorrectedShared()
{
$user = FactoryMuffin::create('FireflyIII\User');
$this->be($user);
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
$amount = $this->object->spentInPeriodCorrected($budget, new Carbon, new Carbon, true);