Expand tests.

This commit is contained in:
James Cole
2017-03-12 09:22:33 +01:00
parent 65dbfcba5c
commit b67dfeced2
13 changed files with 226 additions and 35 deletions

View File

@@ -12,8 +12,17 @@ declare(strict_types = 1);
namespace Tests\Feature\Controllers\Chart;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Models\PiggyBankEvent;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use Illuminate\Support\Collection;
use Tests\TestCase;
/**
* Class PiggyBankControllerTest
*
* @package Tests\Feature\Controllers\Chart
*/
class PiggyBankControllerTest extends TestCase
{
/**
@@ -22,6 +31,13 @@ class PiggyBankControllerTest extends TestCase
*/
public function testHistory()
{
$generator = $this->mock(GeneratorInterface::class);
$repository = $this->mock(PiggyBankRepositoryInterface::class);
$event = factory(PiggyBankEvent::class)->make();
$repository->shouldReceive('getEvents')->andReturn(new Collection([$event]));
$generator->shouldReceive('singleSet')->once()->andReturn([]);
$this->be($this->user());
$response = $this->get(route('chart.piggy-bank.history', [1]));
$response->assertStatus(200);