Fixed tests

This commit is contained in:
James Cole
2015-05-16 09:25:14 +02:00
parent 0a372b0daf
commit e155d3311c
7 changed files with 41 additions and 10 deletions

View File

@@ -212,7 +212,7 @@ class GoogleChartControllerTest extends TestCase
// mock!
$repository = $this->mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface');
$repository->shouldReceive('getFirstActivityDate')->andReturn($start);
$repository->shouldReceive('spentInPeriodSum')->andReturn(rand(1, 100));
$repository->shouldReceive('spentInPeriod')->andReturn(rand(1, 100));
Preferences::shouldReceive('get')->andReturn($pref);
Navigation::shouldReceive('startOfPeriod')->andReturn($start);

View File

@@ -292,11 +292,11 @@ class BudgetRepositoryTest extends TestCase
/**
* @covers FireflyIII\Repositories\Budget\BudgetRepository::spentInMonth
*/
public function testSpentInMonth()
public function testSpentInPeriod()
{
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
$amount = $this->object->spentInMonth($budget, new Carbon);
$amount = $this->object->spentInPeriod($budget, new Carbon, new Carbon);
$this->assertEquals(0, $amount);
}

View File

@@ -189,12 +189,12 @@ class CategoryRepositoryTest extends TestCase
}
/**
* @covers FireflyIII\Repositories\Category\CategoryRepository::spentInPeriodSum
* @covers FireflyIII\Repositories\Category\CategoryRepository::spentInPeriod
*/
public function testSpentInPeriodSum()
{
$category = FactoryMuffin::create('FireflyIII\Models\Category');
$sum = $this->object->spentInPeriodSum($category, new Carbon, new Carbon);
$sum = $this->object->spentInPeriod($category, new Carbon, new Carbon);
$this->assertEquals(0, $sum);