More tests.

This commit is contained in:
James Cole
2016-12-18 19:34:03 +01:00
parent 5c28adf266
commit 8deb92c3e5
7 changed files with 155 additions and 79 deletions

View File

@@ -11,6 +11,8 @@
namespace Chart;
use Carbon\Carbon;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use TestCase;
/**
@@ -37,6 +39,13 @@ class CategoryControllerTest extends TestCase
*/
public function testAll(string $range)
{
$catRepository = $this->mock(CategoryRepositoryInterface::class);
$catRepository->shouldReceive('spentInPeriod')->andReturn('0');
$catRepository->shouldReceive('earnedInPeriod')->andReturn('0');
$catRepository->shouldReceive('firstUseDate')->andReturn(new Carbon);
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('get', route('chart.category.all', [1]));