Speed up some tests.

This commit is contained in:
James Cole
2016-12-22 07:13:37 +01:00
parent 782e2add88
commit e08e7b2c9b
6 changed files with 62 additions and 5 deletions

View File

@@ -11,6 +11,8 @@
namespace Chart;
use Carbon\Carbon;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use TestCase;
/**
@@ -37,6 +39,11 @@ class BudgetControllerTest extends TestCase
*/
public function testBudget(string $range)
{
$budgetRepository = $this->mock(BudgetRepositoryInterface::class);
$budgetRepository->shouldReceive('firstUseDate')->andReturn(new Carbon('2015-01-01'));
$budgetRepository->shouldReceive('spentInPeriod')->andReturn('-100');
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('get', route('chart.budget.budget', [1]));
@@ -51,9 +58,12 @@ class BudgetControllerTest extends TestCase
*/
public function testBudgetLimit(string $range)
{
$budgetRepository = $this->mock(BudgetRepositoryInterface::class);
$budgetRepository->shouldReceive('spentInPeriod')->andReturn('-100');
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('get', route('chart.budget.budget', [1,1]));
$this->call('get', route('chart.budget.budget-limit', [1,1]));
$this->assertResponseStatus(200);
}